diff --git a/build/compiler.js b/build/compiler.js
index f573d2b1..c36f5275 100644
--- a/build/compiler.js
+++ b/build/compiler.js
@@ -10,7 +10,7 @@ const postcss = require('gulp-postcss');
const isProduction = process.env.NODE_ENV === 'production';
const src = path.join(__dirname, '../packages');
const dist = path.join(__dirname, isProduction ? '../dist' : '../example/dist');
-const ext = ['ts', 'less', 'json', 'wxml'];
+const ext = ['ts', 'less', 'json', 'wxml', 'wxs'];
function copy(ext) {
return gulp.src([src + '/**/*.' + ext]).pipe(gulp.dest(dist));
@@ -45,6 +45,7 @@ gulp.task('compile-ts', () =>
})
.pipe(gulp.dest(dist))
);
+gulp.task('compile-wxs', () => copy('wxs'));
gulp.task('compile-json', () => copy('json'));
gulp.task('compile-wxml', () => copy('wxml'));
gulp.task('build', ext.map(ext => 'compile-' + ext));
diff --git a/packages/common/utils.ts b/packages/common/utils.ts
index ade4e679..765c483d 100644
--- a/packages/common/utils.ts
+++ b/packages/common/utils.ts
@@ -11,13 +11,8 @@ function isNumber(value) {
return /^\d+$/.test(value);
}
-function isSrc(url) {
- return /^(https?:)?\/\/|data:image/.test(url);
-}
-
export {
isObj,
isDef,
- isSrc,
isNumber
};
diff --git a/packages/common/utils.wxs b/packages/common/utils.wxs
new file mode 100644
index 00000000..6435ac9e
--- /dev/null
+++ b/packages/common/utils.wxs
@@ -0,0 +1,5 @@
+function isSrc(url) {
+ return url.indexOf('http') === 0 || url.indexOf('data:image') === 0;
+}
+
+module.exports.isSrc = isSrc;
diff --git a/packages/icon/index.ts b/packages/icon/index.ts
index 1e145170..c73f6e73 100644
--- a/packages/icon/index.ts
+++ b/packages/icon/index.ts
@@ -1,4 +1,3 @@
-import { isSrc } from '../common/utils';
import { VantComponent } from '../common/component';
VantComponent({
@@ -14,12 +13,6 @@ VantComponent({
}
},
- computed: {
- isSrc() {
- return isSrc(this.data.name);
- }
- },
-
methods: {
onClick() {
this.$emit('click');
diff --git a/packages/icon/index.wxml b/packages/icon/index.wxml
index 48075534..aefcdebf 100644
--- a/packages/icon/index.wxml
+++ b/packages/icon/index.wxml
@@ -1,5 +1,5 @@
@@ -10,7 +10,9 @@
{{ info }}
+
+