Compare commits

...

2 Commits

Author SHA1 Message Date
nemo-shen
819efae7c8
fix(compiler): watch ts file (#4693) 2021-12-23 10:08:21 +08:00
nemo-shen
79820f7f45
fix(NoticeBar): remove default icon size (#4692) 2021-12-23 10:07:32 +08:00
4 changed files with 44 additions and 25 deletions

View File

@ -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'));
}
)

View File

@ -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_ | - |

View File

@ -9,7 +9,6 @@
>
<van-icon
wx:if="{{ leftIcon }}"
size="16px"
name="{{ leftIcon }}"
class="van-notice-bar__left-icon"
/>

View File

@ -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>