Skip to content

Commit

Permalink
fix: for lint
Browse files Browse the repository at this point in the history
  • Loading branch information
anchengjian committed Apr 8, 2018
1 parent 3f39878 commit 694234c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/core/util/env.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* @flow */
/* globals MutationObserver */

import { noop } from 'shared/util'
import { handleError } from './error'
Expand Down
4 changes: 2 additions & 2 deletions src/platforms/mp/compiler/codegen/convert/attrs.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ function transformDynamicClass (staticClass = '', clsBinding) {
const result = babel.transform(`!${clsBinding}`, { plugins: [transformObjectToTernaryOperator] })
// 先实现功能,再优化代码
// https://github.com/babel/babel/issues/7138
const cls = prettier.format(result.code, { semi: false, singleQuote: true }).slice(1).slice(0, -1).replace(/\n|\r/g, "")
const cls = prettier.format(result.code, { semi: false, singleQuote: true }).slice(1).slice(0, -1).replace(/\n|\r/g, '')
return `${staticClass} {{${cls}}}`
}

function transformDynamicStyle (staticStyle = '', styleBinding) {
const result = babel.transform(`!${styleBinding}`, { plugins: [transformObjectToString] })
const cls = prettier.format(result.code, { semi: false, singleQuote: true }).slice(1).slice(0, -1).replace(/\n|\r/g, "")
const cls = prettier.format(result.code, { semi: false, singleQuote: true }).slice(1).slice(0, -1).replace(/\n|\r/g, '')
return `${staticStyle} {{${cls}}}`
}

Expand Down

0 comments on commit 694234c

Please sign in to comment.