Vue.extend( options )
程序员文章站
2024-03-04 16:46:05
...
Vue.extend( options )
Arguments:
{Object} options
Usage:
Create a “subclass” of the base Vue constructor. The argument should be an object containing component options.
The special case to note here is the data option - it must be a function when used with Vue.extend().
<div id="mount-point"></div>
// create constructor
var Profile = Vue.extend({
template: '<p>{{firstName}} {{lastName}} aka {{alias}}</p>',
data: function () {
return {
firstName: 'Walter',
lastName: 'White',
alias: 'Heisenberg'
}
}
})
// create an instance of Profile and mount it on an element
new Profile().$mount('#mount-point')
Will result in:
<p>Walter White aka Heisenberg</p>
See also: Components
推荐阅读
-
Vue.extend?
-
用Vue.extend()来做一个全局提示组件
-
Vue.extend( options )
-
Vue.extend
-
基于model动态地ComboBox为生成options 博客分类: Ruby RoR RubyF#HTML
-
android BitmapFactory.Options使用方法详解
-
mysql unique option prefix myisam_recover instead of myisam-recover-options的解决方法
-
IE6 easyui combobox options为空或不是对象 博客分类: easyui combobox IE6easyuicombobox
-
Oracle 单实例 Relink Binary Options 说明
-
android BitmapFactory.Options使用方法详解