【发布时间】:2018-08-25 17:53:06
【问题描述】:
我有一个简单的 Vue 实例:
<html>
<body>
<div id="container">
<input type="text" id="container" placeholder="enter text" v-model="value">
<p>{{ value }}</p>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/0.11.10/vue.min.js"></script>
<script>
new Vue({
el: '#container',
data: {
value: '',
list: []
},
created: function() {
console.log(typeof this.list); // i would like to determine type of underlaying object
}
});
</script>
</body>
</html>
https://codepen.io/anon/pen/KxVQEw?editors=1111
如何确定数据中观察到的属性的类型让我们说 .list 在“已创建”生命周期挂钩中?
【问题讨论】:
标签: vue.js