mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2026-07-06 14:51:06 +08:00
Compare commits
2 Commits
8aecb0e843
...
819efae7c8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
819efae7c8 | ||
|
|
79820f7f45 |
@ -134,35 +134,39 @@ tasks.buildExample = gulp.series(
|
||||
.pipe(gulp.dest(`${exampleDistDir}/@vant/icons`)),
|
||||
() => {
|
||||
const appJson = JSON.parse(fs.readFileSync(exampleAppJsonPath));
|
||||
appJson.pages.forEach((path) => {
|
||||
const component = path.replace(/(pages\/|\/index)/g, '');
|
||||
const writeFiles = [
|
||||
{
|
||||
path: `${examplePagesDir}/${component}/index.js`,
|
||||
contents: "import Page from '../../common/page';\n\nPage();",
|
||||
},
|
||||
{
|
||||
path: `${examplePagesDir}/${component}/index.wxml`,
|
||||
contents: `<van-${component}-demo />`,
|
||||
},
|
||||
];
|
||||
writeFiles.forEach((writeFile) => {
|
||||
fs.access(writeFile.path, fs.constants.F_OK, (fileNotExists) => {
|
||||
if (fileNotExists) {
|
||||
fs.writeFile(writeFile.path, writeFile.contents, (err) => {
|
||||
if (err) {
|
||||
throw err;
|
||||
}
|
||||
});
|
||||
}
|
||||
const excludePages = ['pages/dashboard/index'];
|
||||
appJson.pages
|
||||
.filter((page) => page.indexOf(excludePages) === -1)
|
||||
.forEach((path) => {
|
||||
const component = path.replace(/(pages\/|\/index)/g, '');
|
||||
const writeFiles = [
|
||||
{
|
||||
path: `${examplePagesDir}/${component}/index.js`,
|
||||
contents: "import Page from '../../common/page';\n\nPage();",
|
||||
},
|
||||
{
|
||||
path: `${examplePagesDir}/${component}/index.wxml`,
|
||||
contents: `<van-${component}-demo />`,
|
||||
},
|
||||
];
|
||||
writeFiles.forEach((writeFile) => {
|
||||
fs.access(writeFile.path, fs.constants.F_OK, (fileNotExists) => {
|
||||
if (fileNotExists) {
|
||||
fs.writeFile(writeFile.path, writeFile.contents, (err) => {
|
||||
if (err) {
|
||||
throw err;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
() => {
|
||||
gulp.watch(`${src}/**/*.less`, lessCompiler(exampleDistDir));
|
||||
gulp.watch(`${src}/**/*.wxml`, copier(exampleDistDir, 'wxml'));
|
||||
gulp.watch(`${src}/**/*.wxs`, copier(exampleDistDir, 'wxs'));
|
||||
gulp.watch(`${src}/**/*.ts`, tsCompiler(exampleDistDir, exampleConfig));
|
||||
gulp.watch(`${src}/**/*.json`, copier(exampleDistDir, 'json'));
|
||||
}
|
||||
)
|
||||
|
||||
@ -126,3 +126,19 @@
|
||||
| 类名 | 说明 |
|
||||
| ------------ | ------------ |
|
||||
| custom-class | 根节点样式类 |
|
||||
|
||||
### 样式变量
|
||||
|
||||
组件提供了下列 CSS 变量,可用于自定义样式,使用方法请参考 [ConfigProvider 组件](#/config-provider)。
|
||||
|
||||
| 名称 | 默认值 | 描述 |
|
||||
| --- | --- | --- |
|
||||
| --notice-bar-height | _40px_ | - |
|
||||
| --notice-bar-padding | _0 var(--van-padding-md)_ | - |
|
||||
| --notice-bar-wrapable-padding | _var(--van-padding-xs) var(--van-padding-md)_ | - |
|
||||
| --notice-bar-text-color | _var(--van-orange-dark)_ | - |
|
||||
| --notice-bar-font-size | _var(--van-font-size-md)_ | - |
|
||||
| --notice-bar-line-height | _24px_ | - |
|
||||
| --notice-bar-background-color | _var(--van-orange-light)_ | - |
|
||||
| --notice-bar-icon-size | _16px_ | - |
|
||||
| --notice-bar-icon-min-width | _24px_ | - |
|
||||
|
||||
@ -9,7 +9,6 @@
|
||||
>
|
||||
<van-icon
|
||||
wx:if="{{ leftIcon }}"
|
||||
size="16px"
|
||||
name="{{ leftIcon }}"
|
||||
class="van-notice-bar__left-icon"
|
||||
/>
|
||||
|
||||
@ -22,7 +22,7 @@ exports[`should render demo and match snapshot 1`] = `
|
||||
>
|
||||
<wx-view
|
||||
class="custom-class van-icon van-icon-volume-o"
|
||||
style="font-size:16px"
|
||||
style=""
|
||||
bind:tap="onClick"
|
||||
/>
|
||||
</van-icon>
|
||||
@ -225,7 +225,7 @@ exports[`should render demo and match snapshot 1`] = `
|
||||
>
|
||||
<wx-view
|
||||
class="custom-class van-icon van-icon-info-o"
|
||||
style="font-size:16px"
|
||||
style=""
|
||||
bind:tap="onClick"
|
||||
/>
|
||||
</van-icon>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user