提交 89308a2b 编写于 作者: fxy060608's avatar fxy060608

wip(app): nvue

上级 31affe2a
......@@ -26,7 +26,7 @@ export function nvueFactory(exports, document) {
for (var i = 0; i < value.length; i++) {
var item = value[i];
var normalized = isString(item) ? parseStringStyle$1(item) : normalizeStyle(item);
var normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
if (normalized) {
for (var key in normalized) {
......@@ -43,14 +43,14 @@ export function nvueFactory(exports, document) {
}
}
var listDelimiterRE$1 = /;(?![^(]*\))/g;
var propertyDelimiterRE$1 = /:(.+)/;
var listDelimiterRE = /;(?![^(]*\))/g;
var propertyDelimiterRE = /:(.+)/;
function parseStringStyle$1(cssText) {
function parseStringStyle(cssText) {
var ret = {};
cssText.split(listDelimiterRE$1).forEach(item => {
cssText.split(listDelimiterRE).forEach(item => {
if (item) {
var tmp = item.split(propertyDelimiterRE$1);
var tmp = item.split(propertyDelimiterRE);
tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
}
});
......@@ -11047,7 +11047,7 @@ export function nvueFactory(exports, document) {
if (opts['style'].indexOf(key) !== -1) {
if (isString(value)) {
return parseStringStyle$1(value);
return parseStringStyle(value);
}
return normalizeStyle(value);
......@@ -11212,20 +11212,6 @@ export function nvueFactory(exports, document) {
invoker.wxsEvent = invoker.value();
}
var listDelimiterRE = /;(?![^(]*\))/g;
var propertyDelimiterRE = /:(.+)/;
function parseStringStyle(cssText) {
var ret = {};
cssText.split(listDelimiterRE).forEach(item => {
if (item) {
var tmp = item.split(propertyDelimiterRE);
tmp.length > 1 && (ret[camelize(tmp[0].trim())] = tmp[1].trim());
}
});
return ret;
}
function patchStyle(el, prev, next) {
if (!next) {
// TODO remove styles
......@@ -11243,7 +11229,7 @@ export function nvueFactory(exports, document) {
if (isPrevObj) {
for (var key in prev) {
if (next[key] == null) {
batchedStyles[key] = '';
batchedStyles[camelize(key)] = '';
}
}
......@@ -11251,12 +11237,12 @@ export function nvueFactory(exports, document) {
var value = next[_key21];
if (value !== prev[_key21]) {
batchedStyles[_key21] = value;
batchedStyles[camelize(_key21)] = value;
}
}
} else {
for (var _key22 in next) {
batchedStyles[_key22] = next[_key22];
batchedStyles[camelize(_key22)] = next[_key22];
}
}
......
......@@ -26,7 +26,7 @@ export function nvueFactory(exports, document) {
for (var i = 0; i < value.length; i++) {
var item = value[i];
var normalized = isString(item) ? parseStringStyle$1(item) : normalizeStyle(item);
var normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
if (normalized) {
for (var key in normalized) {
......@@ -43,14 +43,14 @@ export function nvueFactory(exports, document) {
}
}
var listDelimiterRE$1 = /;(?![^(]*\))/g;
var propertyDelimiterRE$1 = /:(.+)/;
var listDelimiterRE = /;(?![^(]*\))/g;
var propertyDelimiterRE = /:(.+)/;
function parseStringStyle$1(cssText) {
function parseStringStyle(cssText) {
var ret = {};
cssText.split(listDelimiterRE$1).forEach(item => {
cssText.split(listDelimiterRE).forEach(item => {
if (item) {
var tmp = item.split(propertyDelimiterRE$1);
var tmp = item.split(propertyDelimiterRE);
tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
}
});
......@@ -9220,7 +9220,7 @@ export function nvueFactory(exports, document) {
if (opts['style'].indexOf(key) !== -1) {
if (isString(value)) {
return parseStringStyle$1(value);
return parseStringStyle(value);
}
return normalizeStyle(value);
......@@ -9385,20 +9385,6 @@ export function nvueFactory(exports, document) {
invoker.wxsEvent = invoker.value();
}
var listDelimiterRE = /;(?![^(]*\))/g;
var propertyDelimiterRE = /:(.+)/;
function parseStringStyle(cssText) {
var ret = {};
cssText.split(listDelimiterRE).forEach(item => {
if (item) {
var tmp = item.split(propertyDelimiterRE);
tmp.length > 1 && (ret[camelize(tmp[0].trim())] = tmp[1].trim());
}
});
return ret;
}
function patchStyle(el, prev, next) {
if (!next) {
// TODO remove styles
......@@ -9416,7 +9402,7 @@ export function nvueFactory(exports, document) {
if (isPrevObj) {
for (var key in prev) {
if (next[key] == null) {
batchedStyles[key] = '';
batchedStyles[camelize(key)] = '';
}
}
......@@ -9424,12 +9410,12 @@ export function nvueFactory(exports, document) {
var value = next[_key14];
if (value !== prev[_key14]) {
batchedStyles[_key14] = value;
batchedStyles[camelize(_key14)] = value;
}
}
} else {
for (var _key15 in next) {
batchedStyles[_key15] = next[_key15];
batchedStyles[camelize(_key15)] = next[_key15];
}
}
......
import { NVueTextNode } from '@dcloudio/uni-shared';
import { extend, isArray, isMap, isIntegerKey, isSymbol, hasOwn, isObject, hasChanged, makeMap, capitalize, toRawType, def, isFunction, NOOP, isString, isPromise, getGlobalThis, EMPTY_OBJ, toHandlerKey, toNumber, hyphenate, camelize, isOn, isModelListener, remove, isSet, isPlainObject, invokeArrayFns, isReservedProp, EMPTY_ARR, NO, normalizeClass, normalizeStyle, isGloballyWhitelisted, parseStringStyle as parseStringStyle$1 } from '@vue/shared';
import { extend, isArray, isMap, isIntegerKey, isSymbol, hasOwn, isObject, hasChanged, makeMap, capitalize, toRawType, def, isFunction, NOOP, isString, isPromise, getGlobalThis, EMPTY_OBJ, toHandlerKey, toNumber, hyphenate, camelize, isOn, isModelListener, remove, isSet, isPlainObject, invokeArrayFns, isReservedProp, EMPTY_ARR, NO, normalizeClass, normalizeStyle, isGloballyWhitelisted, parseStringStyle } from '@vue/shared';
export { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared';
function warn(msg, ...args) {
......@@ -8930,7 +8930,7 @@ function transformAttr(el, key, value, instance) {
}
if (opts['style'].indexOf(key) !== -1) {
if (isString(value)) {
return parseStringStyle$1(value);
return parseStringStyle(value);
}
return normalizeStyle(value);
}
......@@ -9062,18 +9062,6 @@ function initWxsEvent(invoker, instance) {
invoker.wxsEvent = invoker.value();
}
const listDelimiterRE = /;(?![^(]*\))/g;
const propertyDelimiterRE = /:(.+)/;
function parseStringStyle(cssText) {
const ret = {};
cssText.split(listDelimiterRE).forEach(item => {
if (item) {
const tmp = item.split(propertyDelimiterRE);
tmp.length > 1 && (ret[camelize(tmp[0].trim())] = tmp[1].trim());
}
});
return ret;
}
function patchStyle(el, prev, next) {
if (!next) {
// TODO remove styles
......@@ -9088,19 +9076,19 @@ function patchStyle(el, prev, next) {
if (isPrevObj) {
for (const key in prev) {
if (next[key] == null) {
batchedStyles[key] = '';
batchedStyles[camelize(key)] = '';
}
}
for (const key in next) {
const value = next[key];
if (value !== prev[key]) {
batchedStyles[key] = value;
batchedStyles[camelize(key)] = value;
}
}
}
else {
for (const key in next) {
batchedStyles[key] = next[key];
batchedStyles[camelize(key)] = next[key];
}
}
el.setStyles(batchedStyles);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册