Я следую образцу, описанному в разделе 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
)
Любая помощь на том, как я мог бы инициализировать эту форму поле будет весьма признателен.
Спасибо