Compare commits

..

No commits in common. "819efae7c8cfb667f4160991564b76a4fc7fda08" and "8aecb0e843f833fa74ea37d9fbace741a2f44f33" have entirely different histories.

4 changed files with 25 additions and 44 deletions

View File

@ -134,39 +134,35 @@ tasks.buildExample = gulp.series(
.pipe(gulp.dest(`${exampleDistDir}/@vant/icons`)),
() => {
const appJson = JSON.parse(fs.readFileSync(exampleAppJsonPath));
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;
}
});
}
});
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;
}
});
}
});
});
});
},
() => {
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,19 +126,3 @@
| 类名 | 说明 |
| ------------ | ------------ |
| 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,6 +9,7 @@
>
<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=""
style="font-size:16px"
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=""
style="font-size:16px"
bind:tap="onClick"
/>
</van-icon>