【发布时间】:2017-10-19 04:53:18
【问题描述】:
我真的对输入元素的“ref”属性感到困惑。根据我的了解,没听说过,也找不到一些有意义的资料。代码在vue.js官方文档中。
<currency-input v-model="price"></currency-input>
这是关于组件的代码:
Vue.component('currency-input', {
template: `
<span>
$
<input
ref="input"
v-bind:value="value"
v-on:input="updateValue($event.target.value)">
</span>
`,
props: ['value'],
ref属性的值等于input是什么意思?
【问题讨论】:
-
ref 代表参考:)
标签: vue.js