-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Closed
Labels
Description
I suggest to allow frozen trees into a data model. Example:
function makeSubModel(val) {
return Object.freeze({
key1: Object.freeze({
key2: val
})
});
}
var data = {
frozenSubModel: makeSubModel('init')
}
new Vue({
// …,
data: data
});
data.frozenSubModel = makeSubModel('changed');
The current version rejects the frozen model: "Cannot define property:__ob__, object is not extensible."
But frozen objects don't need to be observed.
I have several instances of Vue that share the same template. Is there a means to compile the template once?
My current code:
var myTpl = '<div>…</div>';
var vm1 = new Vue({
// …,
template: myTpl
});
var vm2 = new Vue({
// …,
template: myTpl
});
I would like to have:
var compiledTpl = Vue.compile('<div>…</div>');
var vm1 = new Vue({
// …,
template: compiledTpl
});
var vm2 = new Vue({
// …,
template: compiledTpl
});