Commit ffc784a4 authored by 谢卓城's avatar 谢卓城

update

parent e29be3da
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
* 参考文档:https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/wxml-wxss.html * 参考文档:https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/wxml-wxss.html
* 采用 externalClasses 的方式 在组件.wxml需要的view的class加super-class,可以是多个 * 采用 externalClasses 的方式 在组件.wxml需要的view的class加super-class,可以是多个
* 使用 <Component super-class="<#type#>" /> * 使用 <Component super-class="<#type#>" />
* 也可以使用styleIsolation为shared来使用外部样式
*/ */
Component({ Component({
properties: { properties: {
...@@ -10,7 +11,10 @@ Component({ ...@@ -10,7 +11,10 @@ Component({
list: Array, list: Array,
title: String // 简化的定义方式 title: String // 简化的定义方式
}, },
externalClasses: ["super-class"], options: {
styleIsolation: 'apply-shared'
},
externalClasses: [],
data: { data: {
content: "content" content: "content"
}, },
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
* 参考文档:https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/wxml-wxss.html * 参考文档:https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/wxml-wxss.html
* 采用 externalClasses 的方式 在组件.wxml需要的view的class加super-class,可以是多个 * 采用 externalClasses 的方式 在组件.wxml需要的view的class加super-class,可以是多个
* 使用 <Component super-class="<#type#>" /> * 使用 <Component super-class="<#type#>" />
* 也可以使用styleIsolation为apply-shared来使用外部样式
*/ */
Component({ Component({
properties: { properties: {
...@@ -10,6 +11,9 @@ Component({ ...@@ -10,6 +11,9 @@ Component({
list: Array, list: Array,
title: String // 简化的定义方式 title: String // 简化的定义方式
}, },
options: {
styleIsolation: 'apply-shared'
},
externalClasses: ["super-class"], externalClasses: ["super-class"],
data: { data: {
content: "content" content: "content"
......
...@@ -87,7 +87,7 @@ const wxss = () => { ...@@ -87,7 +87,7 @@ const wxss = () => {
.pipe( .pipe(
tap(file => { tap(file => {
const filePath = path.dirname(file.path); const filePath = path.dirname(file.path);
//console.log("filepath", filePath); // console.log("filepath", filePath);
file.contents = Buffer.from( file.contents = Buffer.from(
String(file.contents).replace( String(file.contents).replace(
/@import\s+['|"](.+)['|"];/g, /@import\s+['|"](.+)['|"];/g,
...@@ -213,7 +213,6 @@ const newfile = done => { ...@@ -213,7 +213,6 @@ const newfile = done => {
if(err) console.log(err); if(err) console.log(err);
var json = JSON.parse(data);//读取的值 var json = JSON.parse(data);//读取的值
json.pages.push(`${type}/${name}/${name}`); json.pages.push(`${type}/${name}/${name}`);
console.log(` ${json.pages}`);
//把数据读出来,然后进行修改 //把数据读出来,然后进行修改
var str = JSON.stringify(json,null,2); var str = JSON.stringify(json,null,2);
//console.log(str); //console.log(str);
...@@ -223,8 +222,9 @@ const newfile = done => { ...@@ -223,8 +222,9 @@ const newfile = done => {
} }
}); });
}); });
}else {
stream = stream.pipe(replace('container', `${name}-container`));
} }
return stream.pipe(gulp.dest(`src/${type}/${name}/`)); return stream.pipe(gulp.dest(`src/${type}/${name}/`));
}; };
gulp.task("new", newfile); gulp.task("new", newfile);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment