提交 798b0978 编写于 作者: fxy060608's avatar fxy060608

wip(app): nvue

上级 feb85a52
......@@ -11030,7 +11030,7 @@ export function nvueFactory(exports, document) {
var instance = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
if (instance) {
value = transformAttr(el, key, value, instance);
[key, value] = transformAttr(el, key, value, instance);
}
if (value == null) ;else {
......@@ -11038,13 +11038,13 @@ export function nvueFactory(exports, document) {
}
}
var ATTR_HOVER_CLASS = 'hoverClass';
var ATTR_PLACEHOLDER_CLASS = 'placeholderClass';
var ATTR_PLACEHOLDER_STYLE = 'placeholderStyle';
var ATTR_INDICATOR_CLASS = 'indicatorClass';
var ATTR_INDICATOR_STYLE = 'indicatorStyle';
var ATTR_MASK_CLASS = 'maskClass';
var ATTR_MASK_STYLE = 'maskStyle';
var ATTR_HOVER_CLASS = 'hover-class';
var ATTR_PLACEHOLDER_CLASS = 'placeholder-class';
var ATTR_PLACEHOLDER_STYLE = 'placeholder-style';
var ATTR_INDICATOR_CLASS = 'indicator-class';
var ATTR_INDICATOR_STYLE = 'indicator-style';
var ATTR_MASK_CLASS = 'mask-class';
var ATTR_MASK_STYLE = 'mask-style';
var CLASS_AND_STYLES = {
view: {
class: [ATTR_HOVER_CLASS],
......@@ -11074,26 +11074,26 @@ export function nvueFactory(exports, document) {
function transformAttr(el, key, value, instance) {
if (!value) {
return value;
return [key, value];
}
var opts = CLASS_AND_STYLES[el.type];
if (opts) {
if (opts['class'].indexOf(key) !== -1) {
return parseStylesheet(instance)[value] || {};
return [camelize(key), parseStylesheet(instance)[value] || {}];
}
if (opts['style'].indexOf(key) !== -1) {
if (isString(value)) {
return parseStringStyle(value);
return [camelize(key), parseStringStyle(value)];
}
return normalizeStyle(value);
return [camelize(key), normalizeStyle(value)];
}
}
return value;
return [key, value];
} // compiler should normalize class + :class bindings on the same element
// into a single binding ['staticClass', dynamic]
......
......@@ -9205,7 +9205,7 @@ export function nvueFactory(exports, document) {
var instance = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
if (instance) {
value = transformAttr(el, key, value, instance);
[key, value] = transformAttr(el, key, value, instance);
}
if (value == null) ;else {
......@@ -9213,13 +9213,13 @@ export function nvueFactory(exports, document) {
}
}
var ATTR_HOVER_CLASS = 'hoverClass';
var ATTR_PLACEHOLDER_CLASS = 'placeholderClass';
var ATTR_PLACEHOLDER_STYLE = 'placeholderStyle';
var ATTR_INDICATOR_CLASS = 'indicatorClass';
var ATTR_INDICATOR_STYLE = 'indicatorStyle';
var ATTR_MASK_CLASS = 'maskClass';
var ATTR_MASK_STYLE = 'maskStyle';
var ATTR_HOVER_CLASS = 'hover-class';
var ATTR_PLACEHOLDER_CLASS = 'placeholder-class';
var ATTR_PLACEHOLDER_STYLE = 'placeholder-style';
var ATTR_INDICATOR_CLASS = 'indicator-class';
var ATTR_INDICATOR_STYLE = 'indicator-style';
var ATTR_MASK_CLASS = 'mask-class';
var ATTR_MASK_STYLE = 'mask-style';
var CLASS_AND_STYLES = {
view: {
class: [ATTR_HOVER_CLASS],
......@@ -9249,26 +9249,26 @@ export function nvueFactory(exports, document) {
function transformAttr(el, key, value, instance) {
if (!value) {
return value;
return [key, value];
}
var opts = CLASS_AND_STYLES[el.type];
if (opts) {
if (opts['class'].indexOf(key) !== -1) {
return parseStylesheet(instance)[value] || {};
return [camelize(key), parseStylesheet(instance)[value] || {}];
}
if (opts['style'].indexOf(key) !== -1) {
if (isString(value)) {
return parseStringStyle(value);
return [camelize(key), parseStringStyle(value)];
}
return normalizeStyle(value);
return [camelize(key), normalizeStyle(value)];
}
}
return value;
return [key, value];
} // compiler should normalize class + :class bindings on the same element
// into a single binding ['staticClass', dynamic]
......
......@@ -8909,20 +8909,20 @@ function isUndef(val) {
function patchAttr(el, key, value, instance = null) {
if (instance) {
value = transformAttr(el, key, value, instance);
[key, value] = transformAttr(el, key, value, instance);
}
if (value == null) ;
else {
el.setAttr(key, value);
}
}
const ATTR_HOVER_CLASS = 'hoverClass';
const ATTR_PLACEHOLDER_CLASS = 'placeholderClass';
const ATTR_PLACEHOLDER_STYLE = 'placeholderStyle';
const ATTR_INDICATOR_CLASS = 'indicatorClass';
const ATTR_INDICATOR_STYLE = 'indicatorStyle';
const ATTR_MASK_CLASS = 'maskClass';
const ATTR_MASK_STYLE = 'maskStyle';
const ATTR_HOVER_CLASS = 'hover-class';
const ATTR_PLACEHOLDER_CLASS = 'placeholder-class';
const ATTR_PLACEHOLDER_STYLE = 'placeholder-style';
const ATTR_INDICATOR_CLASS = 'indicator-class';
const ATTR_INDICATOR_STYLE = 'indicator-style';
const ATTR_MASK_CLASS = 'mask-class';
const ATTR_MASK_STYLE = 'mask-style';
const CLASS_AND_STYLES = {
view: {
class: [ATTR_HOVER_CLASS],
......@@ -8951,21 +8951,21 @@ const CLASS_AND_STYLES = {
};
function transformAttr(el, key, value, instance) {
if (!value) {
return value;
return [key, value];
}
const opts = CLASS_AND_STYLES[el.type];
if (opts) {
if (opts['class'].indexOf(key) !== -1) {
return parseStylesheet(instance)[value] || {};
return [camelize(key), parseStylesheet(instance)[value] || {}];
}
if (opts['style'].indexOf(key) !== -1) {
if (isString(value)) {
return parseStringStyle(value);
return [camelize(key), parseStringStyle(value)];
}
return normalizeStyle(value);
return [camelize(key), normalizeStyle(value)];
}
}
return value;
return [key, value];
}
// compiler should normalize class + :class bindings on the same element
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册