diff --git a/build.dev.js b/build.dev.js index 4bce90e..d88ce45 100644 --- a/build.dev.js +++ b/build.dev.js @@ -4,7 +4,6 @@ require('es.shim') const log = console.log const fs = require('iofs') const path = require('path') -const babel = require('babel-core') const scss = require('node-sass') const chokidar = require('chokidar') const chalk = require('chalk') @@ -69,7 +68,12 @@ function mkWCFile({ style, html, js }) { js = js.replace(/props = (\{[\w\W]*?\n\s{2}?\})/, function(s, m) { props = m var attr = new Function( - `var props = ${m}, attr = []; for(var i in props){attr.push(i)}; return attr` + `try { + var props = ${m}, attr = [] + for(var i in props){attr.push(i)} + return attr + } catch(err) {console.error(err);return []} + ` )() return `static get observedAttributes() { return ${JSON.stringify(attr)} @@ -161,17 +165,19 @@ chokidar return } - switch (file.ext) { - case '.js': - compileJs(entry, output) - break - case '.wc': - output = output.replace(/\.wc$/, '.js') - compileWC(entry, output) - break - default: - fs.cp(entry, output) - } + setTimeout(() => { + switch (file.ext) { + case '.js': + compileJs(entry, output) + break + case '.wc': + output = output.replace(/\.wc$/, '.js') + compileWC(entry, output) + break + default: + fs.cp(entry, output) + } + }, 100) } }) .on('ready', () => { diff --git a/src/datepicker/index.js b/src/datepicker/index.js index 787a267..58c2385 100644 --- a/src/datepicker/index.js +++ b/src/datepicker/index.js @@ -18,14 +18,14 @@ function getCalendarTable({ year, month, max, min }, last) { for (let i = numsFixed; i <= nums; i++) { let day = { - weeken: !1, + weekend: !1, day: i < 1 ? '' : i, selected: !1, disabled: !0 } if (i > 0) { let week = getFirstDay(year, month, i) - day.weeken = week === 0 || week === 6 + day.weekend = week === 0 || week === 6 day.selected = isSelected({ year, month, day: i }, last) day.disabled = disabledDay({ max, min }, i, isLimitYM) } @@ -241,7 +241,7 @@ export default Anot.component('datepicker', {
diff --git a/src/icon/index.wc b/src/icon/index.wc index b8c0588..3d2587b 100644 --- a/src/icon/index.wc +++ b/src/icon/index.wc @@ -121,6 +121,10 @@ export default class Icon { } } + get is() { + return this.props.is + } + set is(val) { this.props.is = val this.drawPath() diff --git a/src/picker/date.wc b/src/picker/date.wc index 78b8c22..17e53cd 100644 --- a/src/picker/date.wc +++ b/src/picker/date.wc @@ -1,22 +1,34 @@