0
구성 요소를 사용하여보기를로드하는 중 official documentation에 설명 된 패턴을 따르고 있습니다. 구성 요소 중 하나에는 양식 필드가 있습니다. 이후 .tagsinput()
이라는 메쏘드가 필요합니다. TagsInput을 사용하고 있습니다. 그래서, $('#tags').tagsinput()
과 같은 것입니다. 다음은 내가하고있는 작업의 단순화 된 버전입니다.
CreateBoardForm = Vue.extend
template: "<input type='text' v-text='tags' id='tags'/>"
data:
tags: ''
ready: ->
// this is where I'm hoping to access
// tags and call $('#tags').tagsinput() on it
// However, this.$el and this.template are all undefined
// I was hoping to do something like this.$el.find('#tags').tagsinput()
Vue.component('CreateBoardForm', CreateBoardForm)
vue = new Vue(
el: '#main',
data:
currentView: 'createBoardForm'
components:
createBoardForm: CreateBoardForm
)
양식 필드를 초기화하는 방법에 대한 도움을 주시면 감사하겠습니다.
고마워요.