【发布时间】:2017-01-06 10:11:06
【问题描述】:
我在 Vuejs 中使用了bootstrap-toggle。运行项目时出现错误“bootstrapToggle 不是函数”
这是我的 VueJs 组件的样子
<template>
<input type='checkbox' id="toggle-checked" v-model="active">
</template>
<script type="text/babel">
import $ from 'jquery'
require('bootstrap-toggle')
export default {
data () {
return {
active: 1
}
},
mounted: function () {
$('#toggle-checked').bootstrapToggle()
}
}
</script>
【问题讨论】:
标签: jquery twitter-bootstrap twitter-bootstrap-3 vuejs2