This repository has been archived on 2023-08-30. You can view files and clone it, but cannot push or open issues/pull-requests.
bytedo
/
wcui
Archived
1
0
Fork 0

优化attr指令并

old
宇天 2018-06-23 02:43:00 +08:00
parent e9ca20f621
commit 9f9456618e
4 changed files with 32 additions and 24 deletions

View File

@ -3361,6 +3361,8 @@ const _Anot = (function() {
function getOptionsFromTag(elem, vmodels) {
var attributes = aslice.call(elem.attributes, 0)
var ret = {}
var vm = vmodels[0] || {}
for (var i = 0, attr; (attr = attributes[i++]); ) {
var name = attr.name
if (
@ -3376,9 +3378,7 @@ const _Anot = (function() {
var camelizeName = camelize(name)
if (camelizeName.indexOf('@') === 0) {
camelizeName = camelizeName.slice(1)
var vm = vmodels[0]
if (
vm &&
vm.hasOwnProperty(attr.value) &&
typeof vm[attr.value] === 'function'
) {
@ -4077,7 +4077,7 @@ const _Anot = (function() {
var outer = (binding.includeReplace = !!Anot(elem).data(
'includeReplace'
))
if (Anot(elem).data('includeCache')) {
if (Anot(elem).data('cache')) {
binding.templateCache = {}
}
binding.start = DOC.createComment(':include')
@ -4098,15 +4098,17 @@ const _Anot = (function() {
var obj = {}
var vm = this.vmodels[0]
val = toJson(val)
if (this.param) {
if (typeof val === 'object' && val !== null) {
if (Array.isArray(val)) {
obj[this.param] = val.$model || val
obj[this.param] = val
} else {
if (Date.isDate(val)) {
obj[this.param] = val.toUTCString()
} else {
obj[this.param] = val.$model || val
obj[this.param] = val
}
}
} else {
@ -4120,7 +4122,7 @@ const _Anot = (function() {
return
}
obj = val.$model || val
obj = val
}
for (var i in obj) {

View File

@ -3376,6 +3376,8 @@
function getOptionsFromTag(elem, vmodels) {
var attributes = aslice.call(elem.attributes, 0)
var ret = {}
var vm = vmodels[0] || {}
for (var i = 0, attr; (attr = attributes[i++]); ) {
var name = attr.name
if (
@ -3391,9 +3393,7 @@
var camelizeName = camelize(name)
if (camelizeName.indexOf('@') === 0) {
camelizeName = camelizeName.slice(1)
var vm = vmodels[0]
if (
vm &&
vm.hasOwnProperty(attr.value) &&
typeof vm[attr.value] === 'function'
) {
@ -4092,7 +4092,7 @@
var outer = (binding.includeReplace = !!Anot(elem).data(
'includeReplace'
))
if (Anot(elem).data('includeCache')) {
if (Anot(elem).data('cache')) {
binding.templateCache = {}
}
binding.start = DOC.createComment(':include')
@ -4113,15 +4113,17 @@
var obj = {}
var vm = this.vmodels[0]
val = toJson(val)
if (this.param) {
if (typeof val === 'object' && val !== null) {
if (Array.isArray(val)) {
obj[this.param] = val.$model || val
obj[this.param] = val
} else {
if (Date.isDate(val)) {
obj[this.param] = val.toUTCString()
} else {
obj[this.param] = val.$model || val
obj[this.param] = val
}
}
} else {
@ -4135,7 +4137,7 @@
return
}
obj = val.$model || val
obj = val
}
for (var i in obj) {

View File

@ -3361,6 +3361,8 @@ const _Anot = (function() {
function getOptionsFromTag(elem, vmodels) {
var attributes = aslice.call(elem.attributes, 0)
var ret = {}
var vm = vmodels[0] || {}
for (var i = 0, attr; (attr = attributes[i++]); ) {
var name = attr.name
if (
@ -3376,9 +3378,7 @@ const _Anot = (function() {
var camelizeName = camelize(name)
if (camelizeName.indexOf('@') === 0) {
camelizeName = camelizeName.slice(1)
var vm = vmodels[0]
if (
vm &&
vm.hasOwnProperty(attr.value) &&
typeof vm[attr.value] === 'function'
) {
@ -4077,7 +4077,7 @@ const _Anot = (function() {
var outer = (binding.includeReplace = !!Anot(elem).data(
'includeReplace'
))
if (Anot(elem).data('includeCache')) {
if (Anot(elem).data('cache')) {
binding.templateCache = {}
}
binding.start = DOC.createComment(':include')
@ -4098,15 +4098,17 @@ const _Anot = (function() {
var obj = {}
var vm = this.vmodels[0]
val = toJson(val)
if (this.param) {
if (typeof val === 'object' && val !== null) {
if (Array.isArray(val)) {
obj[this.param] = val.$model || val
obj[this.param] = val
} else {
if (Date.isDate(val)) {
obj[this.param] = val.toUTCString()
} else {
obj[this.param] = val.$model || val
obj[this.param] = val
}
}
} else {
@ -4120,7 +4122,7 @@ const _Anot = (function() {
return
}
obj = val.$model || val
obj = val
}
for (var i in obj) {

View File

@ -3376,6 +3376,8 @@
function getOptionsFromTag(elem, vmodels) {
var attributes = aslice.call(elem.attributes, 0)
var ret = {}
var vm = vmodels[0] || {}
for (var i = 0, attr; (attr = attributes[i++]); ) {
var name = attr.name
if (
@ -3391,9 +3393,7 @@
var camelizeName = camelize(name)
if (camelizeName.indexOf('@') === 0) {
camelizeName = camelizeName.slice(1)
var vm = vmodels[0]
if (
vm &&
vm.hasOwnProperty(attr.value) &&
typeof vm[attr.value] === 'function'
) {
@ -4092,7 +4092,7 @@
var outer = (binding.includeReplace = !!Anot(elem).data(
'includeReplace'
))
if (Anot(elem).data('includeCache')) {
if (Anot(elem).data('cache')) {
binding.templateCache = {}
}
binding.start = DOC.createComment(':include')
@ -4113,15 +4113,17 @@
var obj = {}
var vm = this.vmodels[0]
val = toJson(val)
if (this.param) {
if (typeof val === 'object' && val !== null) {
if (Array.isArray(val)) {
obj[this.param] = val.$model || val
obj[this.param] = val
} else {
if (Date.isDate(val)) {
obj[this.param] = val.toUTCString()
} else {
obj[this.param] = val.$model || val
obj[this.param] = val
}
}
} else {
@ -4135,7 +4137,7 @@
return
}
obj = val.$model || val
obj = val
}
for (var i in obj) {