标签:
一、如何禁止avalon自带的amd模型
priority:[‘text‘,‘css‘]
require.config({
//baseUrl:‘‘,
paths:{
‘text‘:‘../file/text‘,
‘css‘:‘../file/css‘,
‘avalon‘:‘../bower_components/avalon/avalon.shim‘,
‘datepickers‘:‘../file/datepicker/avalon.datepicker‘,
‘notice‘:‘../file/notice/avalon.notice‘
},
priority:[‘text‘,‘css‘]
})
require([‘../demo/datepicker/app/datepicker_demo‘],function(){
})
<scriptdata-main="../../main/datepicker"deferasync="true"type="text/javascript"src="../../bower_components/requirejs/require.js"></script>
define([‘avalon‘,‘notice‘],function(){
var model = avalon.define("noticeDemo", function(vm) {
vm.$bOpts = {
header: "提示信息title",
content: "提示信息content"
}
vm.changeHeader = function(id) {
var vmodel = avalon.vmodels[id];
vmodel.header = "new notice title"
}
vm.changeContent = function(id) {
var vmodel = avalon.vmodels[id];
vmodel.content = "new notice content, yeap !"
}
vm.toggleType = function(id) {
var typeArr = ["info", "success", "error"];
var noticeVM = avalon.vmodels[id];
var index = Math.floor(Math.random()*3);
noticeVM.type = typeArr[index];
}
vm.toggleNotice = function(id) {
var noticeVm = avalon.vmodels[id];
noticeVm.toggle = !noticeVm.toggle;
}
})
avalon.scan();
})
avalon学习笔记ui篇-如何将avalon默认的amd模型禁止,以及用require重写。
标签:
原文地址:http://www.cnblogs.com/Zjingwen/p/4477990.html