From cd54e133a2bd13a8ba87e8ae567a850cda9f9cbf Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 7 Jan 2022 11:08:08 +0800 Subject: [PATCH] lzzkage1@163.com Signed-off-by: unknown --- .../plugin/templater/component_validator.js | 6 +----- ace-loader/src/resource-reference-style.js | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 ace-loader/src/resource-reference-style.js diff --git a/ace-loader/plugin/templater/component_validator.js b/ace-loader/plugin/templater/component_validator.js index 93ca88b..19eb4e9 100644 --- a/ace-loader/plugin/templater/component_validator.js +++ b/ace-loader/plugin/templater/component_validator.js @@ -783,11 +783,7 @@ function processCssArray(css, out, nodeLoc, cssStyle, cssArray, log) { let value = bind(styleContent[1].trim(), undefined, true, out, nodeLoc) const contentValue = styleContent[1].trim().toString(); if (contentValue.match(/^linear-gradient/) && contentValue.match(/\(.*\{\{.*\}\}.*\)/)) { - log.push({ - line: nodeLoc.line || 1, - column: nodeLoc.col || 1, - reason: `ERROR: can not bind data for linear-gradient in inline style at ${css}` - }) + value = styleContent[1].trim(); } if (key === 'flex' && typeof value === 'string') { expandFlex(key, value, cssStyle, nodeLoc, log) diff --git a/ace-loader/src/resource-reference-style.js b/ace-loader/src/resource-reference-style.js new file mode 100644 index 0000000..7c349f9 --- /dev/null +++ b/ace-loader/src/resource-reference-style.js @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module.exports = function (source) { + this.cacheable && this.cacheable() + const callback = this.async() + callback(null, JSON.stringify({})) +} \ No newline at end of file -- Gitee