mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix lint
This commit is contained in:
parent
b8a16cabc2
commit
05edb4a391
@ -21,7 +21,8 @@ module.exports = {
|
|||||||
zanui: true,
|
zanui: true,
|
||||||
document: false,
|
document: false,
|
||||||
navigator: false,
|
navigator: false,
|
||||||
window: false
|
window: false,
|
||||||
|
require: true
|
||||||
},
|
},
|
||||||
|
|
||||||
env: {
|
env: {
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
"build:zanui-css": "gulp build --gulpfile packages/zanui-css/gulpfile.js && cp-cli packages/zanui-css/lib lib/zanui-css",
|
"build:zanui-css": "gulp build --gulpfile packages/zanui-css/gulpfile.js && cp-cli packages/zanui-css/lib lib/zanui-css",
|
||||||
"build:components": "cross-env NODE_ENV=production webpack --progress --hide-modules --config build/webpack.components.js",
|
"build:components": "cross-env NODE_ENV=production webpack --progress --hide-modules --config build/webpack.components.js",
|
||||||
"build:zanui": "webpack --progress --hide-modules --config build/webpack.build.js && webpack --progress --hide-modules --config build/webpack.build.min.js",
|
"build:zanui": "webpack --progress --hide-modules --config build/webpack.build.js && webpack --progress --hide-modules --config build/webpack.build.min.js",
|
||||||
"dist": "npm run clean && npm run build:file && npm run lint && npm run build:zanui && npm run build:utils && npm run build:zanui-css",
|
"dist": "npm run clean && npm run build:file && npm run lint && npm run build:zanui && npm run build:components && npm run build:utils && npm run build:zanui-css",
|
||||||
"builddocs": "cross-env NODE_ENV=production webpack --progress --hide-modules --config build/webpack.config.js",
|
"builddocs": "cross-env NODE_ENV=production webpack --progress --hide-modules --config build/webpack.config.js",
|
||||||
"clean": "rimraf lib && rimraf packages/*/lib",
|
"clean": "rimraf lib && rimraf packages/*/lib",
|
||||||
"lint": "eslint src/**/*.js packages/**/*.{js,vue} --quiet",
|
"lint": "eslint src/**/*.js packages/**/*.{js,vue} --quiet",
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
{{title}}
|
{{title}}
|
||||||
</a>
|
</a>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'zan-badge',
|
name: 'zan-badge',
|
||||||
|
@ -66,8 +66,8 @@ export default {
|
|||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
values() {
|
values() {
|
||||||
let columns = this.columns || [];
|
const columns = this.columns || [];
|
||||||
let values = [];
|
const values = [];
|
||||||
|
|
||||||
columns.forEach(column => {
|
columns.forEach(column => {
|
||||||
values.push(column.value || column.values[column.defaultIndex || 0]);
|
values.push(column.value || column.values[column.defaultIndex || 0]);
|
||||||
@ -89,7 +89,7 @@ export default {
|
|||||||
* 获取对应索引的列的实例
|
* 获取对应索引的列的实例
|
||||||
*/
|
*/
|
||||||
getColumn(index) {
|
getColumn(index) {
|
||||||
let children = this.$children.filter(child => child.$options.name === 'zan-picker-column');
|
const children = this.$children.filter(child => child.$options.name === 'zan-picker-column');
|
||||||
return children[index];
|
return children[index];
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -97,7 +97,7 @@ export default {
|
|||||||
* 获取对应列中选中的值
|
* 获取对应列中选中的值
|
||||||
*/
|
*/
|
||||||
getColumnValue(index) {
|
getColumnValue(index) {
|
||||||
let column = this.getColumn(index);
|
const column = this.getColumn(index);
|
||||||
return column && column.values[column.valueIndex];
|
return column && column.values[column.valueIndex];
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -105,7 +105,7 @@ export default {
|
|||||||
* 设置对应列中选中的值
|
* 设置对应列中选中的值
|
||||||
*/
|
*/
|
||||||
setColumnValue(index, value) {
|
setColumnValue(index, value) {
|
||||||
let column = this.getColumn(index);
|
const column = this.getColumn(index);
|
||||||
if (column) {
|
if (column) {
|
||||||
column.currentValue = value;
|
column.currentValue = value;
|
||||||
}
|
}
|
||||||
@ -115,7 +115,7 @@ export default {
|
|||||||
* 获取对应列中所有的备选值
|
* 获取对应列中所有的备选值
|
||||||
*/
|
*/
|
||||||
getColumnValues(index) {
|
getColumnValues(index) {
|
||||||
let column = this.getColumn(index);
|
const column = this.getColumn(index);
|
||||||
return column && column.currentValues;
|
return column && column.currentValues;
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -123,7 +123,7 @@ export default {
|
|||||||
* 设置对应列中所有的备选值
|
* 设置对应列中所有的备选值
|
||||||
*/
|
*/
|
||||||
setColumnValues(index, values) {
|
setColumnValues(index, values) {
|
||||||
let column = this.getColumn(index);
|
const column = this.getColumn(index);
|
||||||
if (column) {
|
if (column) {
|
||||||
column.currentValues = values;
|
column.currentValues = values;
|
||||||
}
|
}
|
||||||
|
@ -21,8 +21,8 @@ export default {
|
|||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
status() {
|
status() {
|
||||||
let index = this.$parent.steps.indexOf(this);
|
const index = this.$parent.steps.indexOf(this);
|
||||||
let active = this.$parent.active;
|
const active = this.$parent.active;
|
||||||
|
|
||||||
if (index === -1) {
|
if (index === -1) {
|
||||||
return '';
|
return '';
|
||||||
|
@ -34,8 +34,8 @@ export default {
|
|||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
computedIconClass() {
|
computedIconClass() {
|
||||||
let iconName = `zan-icon-${this.icon}`;
|
const iconName = `zan-icon-${this.icon}`;
|
||||||
let result = this.iconClass.split(' ');
|
const result = this.iconClass.split(' ');
|
||||||
result.push(iconName);
|
result.push(iconName);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@ -42,7 +42,7 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
switchStates: function() {
|
switchStates: function() {
|
||||||
let switchStates = ['zan-switch--' + (this.checked ? 'on' : 'off'),
|
const switchStates = ['zan-switch--' + (this.checked ? 'on' : 'off'),
|
||||||
'zan-switch--' + (this.disabled ? 'disabled' : '')];
|
'zan-switch--' + (this.disabled ? 'disabled' : '')];
|
||||||
|
|
||||||
return switchStates;
|
return switchStates;
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
export default function(target, ...sources) {
|
export default function(target, ...sources) {
|
||||||
for (let i = 0; i < sources.length; i++) {
|
for (let i = 0; i < sources.length; i++) {
|
||||||
let source = sources[i] || {};
|
const source = sources[i] || {};
|
||||||
for (let prop in source) {
|
for (const prop in source) {
|
||||||
if (source.hasOwnProperty(prop)) {
|
if (source.hasOwnProperty(prop)) {
|
||||||
let value = source[prop];
|
const value = source[prop];
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
target[prop] = value;
|
target[prop] = value;
|
||||||
}
|
}
|
||||||
|
@ -17,9 +17,9 @@ if (!Vue.prototype.$isServer) {
|
|||||||
engine = 'trident';
|
engine = 'trident';
|
||||||
}
|
}
|
||||||
|
|
||||||
var cssPrefix = {trident: '-ms-', gecko: '-moz-', webkit: '-webkit-', presto: '-o-'}[engine];
|
var cssPrefix = { trident: '-ms-', gecko: '-moz-', webkit: '-webkit-', presto: '-o-' }[engine];
|
||||||
|
|
||||||
var vendorPrefix = {trident: 'ms', gecko: 'Moz', webkit: 'Webkit', presto: 'O'}[engine];
|
var vendorPrefix = { trident: 'ms', gecko: 'Moz', webkit: 'Webkit', presto: 'O' }[engine];
|
||||||
|
|
||||||
var helperElem = document.createElement('div');
|
var helperElem = document.createElement('div');
|
||||||
var perspectiveProperty = vendorPrefix + 'Perspective';
|
var perspectiveProperty = vendorPrefix + 'Perspective';
|
||||||
@ -34,7 +34,7 @@ if (!Vue.prototype.$isServer) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var getTranslate = function(element) {
|
var getTranslate = function(element) {
|
||||||
var result = {left: 0, top: 0};
|
var result = { left: 0, top: 0 };
|
||||||
if (element === null || element.style === null) return result;
|
if (element === null || element.style === null) return result;
|
||||||
|
|
||||||
var transform = element.style[transformProperty];
|
var transform = element.style[transformProperty];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user