Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
MiniprogramTemplate
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
谢卓城
MiniprogramTemplate
Commits
ffc784a4
Commit
ffc784a4
authored
Mar 03, 2021
by
谢卓城
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
e29be3da
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
4 deletions
+12
-4
index.js
.template/components/Test/index.js
+5
-1
index.js
.template/components/index/index.js
+4
-0
gulpfile.js
gulpfile.js
+3
-3
No files found.
.template/components/Test/index.js
View file @
ffc784a4
...
...
@@ -3,6 +3,7 @@
* 参考文档:https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/wxml-wxss.html
* 采用 externalClasses 的方式 在组件.wxml需要的view的class加super-class,可以是多个
* 使用 <Component super-class="<#type#>" />
* 也可以使用styleIsolation为shared来使用外部样式
*/
Component
({
properties
:
{
...
...
@@ -10,7 +11,10 @@ Component({
list
:
Array
,
title
:
String
// 简化的定义方式
},
externalClasses
:
[
"super-class"
],
options
:
{
styleIsolation
:
'apply-shared'
},
externalClasses
:
[],
data
:
{
content
:
"content"
},
...
...
.template/components/index/index.js
View file @
ffc784a4
...
...
@@ -3,6 +3,7 @@
* 参考文档:https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/wxml-wxss.html
* 采用 externalClasses 的方式 在组件.wxml需要的view的class加super-class,可以是多个
* 使用 <Component super-class="<#type#>" />
* 也可以使用styleIsolation为apply-shared来使用外部样式
*/
Component
({
properties
:
{
...
...
@@ -10,6 +11,9 @@ Component({
list
:
Array
,
title
:
String
// 简化的定义方式
},
options
:
{
styleIsolation
:
'apply-shared'
},
externalClasses
:
[
"super-class"
],
data
:
{
content
:
"content"
...
...
gulpfile.js
View file @
ffc784a4
...
...
@@ -87,7 +87,7 @@ const wxss = () => {
.
pipe
(
tap
(
file
=>
{
const
filePath
=
path
.
dirname
(
file
.
path
);
//console.log("filepath", filePath);
//
console.log("filepath", filePath);
file
.
contents
=
Buffer
.
from
(
String
(
file
.
contents
).
replace
(
/@import
\s
+
[
'|"
](
.+
)[
'|"
]
;/g
,
...
...
@@ -213,7 +213,6 @@ const newfile = done => {
if
(
err
)
console
.
log
(
err
);
var
json
=
JSON
.
parse
(
data
);
//读取的值
json
.
pages
.
push
(
`
${
type
}
/
${
name
}
/
${
name
}
`
);
console
.
log
(
`
${
json
.
pages
}
`
);
//把数据读出来,然后进行修改
var
str
=
JSON
.
stringify
(
json
,
null
,
2
);
//console.log(str);
...
...
@@ -223,8 +222,9 @@ const newfile = done => {
}
});
});
}
else
{
stream
=
stream
.
pipe
(
replace
(
'container'
,
`
${
name
}
-container`
));
}
return
stream
.
pipe
(
gulp
.
dest
(
`src/
${
type
}
/
${
name
}
/`
));
};
gulp
.
task
(
"new"
,
newfile
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment