Skip to content

Commit ff55102

Browse files
committed
wip: fix flow type for weex merge
1 parent cb253d7 commit ff55102

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

Diff for: flow/compiler.js

+3
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ declare type ASTElement = {
120120
once?: true;
121121
onceProcessed?: boolean;
122122
wrapData?: (code: string) => string;
123+
124+
// weex specific
125+
atom?: boolean;
123126
}
124127

125128
declare type ASTExpression = {

Diff for: flow/vnode.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ declare type VNodeWithData = {
2121
data: VNodeData;
2222
children: Array<VNode> | void;
2323
text: void;
24-
elm: HTMLElement;
24+
elm: any;
2525
ns: string | void;
2626
context: Component;
2727
key: string | number | void;

Diff for: src/platforms/weex/compiler/index.js

-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
const cache: { [key: string]: CompiledFunctionResult } = Object.create(null)
1515

1616
export const baseOptions: CompilerOptions = {
17-
1817
preserveWhitespace: false,
1918
modules,
2019
staticKeys: genStaticKeys(modules),
@@ -23,7 +22,6 @@ export const baseOptions: CompilerOptions = {
2322
isUnaryTag,
2423
mustUseProp,
2524
getTagNamespace
26-
2725
}
2826

2927
export function compile (

Diff for: src/platforms/weex/compiler/modules/class.js

+7-9
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,12 @@ function transformNode (el: ASTElement, options: CompilerOptions) {
1616
const warn = options.warn || baseWarn
1717
const staticClass = getAndRemoveAttr(el, 'class')
1818
const { dynamic, classResult } = parseStaticClass(staticClass, options)
19-
if (dynamic) {
20-
if (process.env.NODE_ENV !== 'production') {
21-
warn(
22-
`class="${staticClass}": ` +
23-
'Interpolation inside attributes has been deprecated. ' +
24-
'Use v-bind or the colon shorthand instead.'
25-
)
26-
}
19+
if (process.env.NODE_ENV !== 'production' && dynamic && staticClass) {
20+
warn(
21+
`class="${staticClass}": ` +
22+
'Interpolation inside attributes has been deprecated. ' +
23+
'Use v-bind or the colon shorthand instead.'
24+
)
2725
}
2826
if (!dynamic && classResult) {
2927
el.staticClass = classResult
@@ -47,7 +45,7 @@ function genData (el: ASTElement): string {
4745
return data
4846
}
4947

50-
function parseStaticClass (staticClass?: string, options: CompilerOptions): StaticClassResult {
48+
function parseStaticClass (staticClass: ?string, options: CompilerOptions): StaticClassResult {
5149
// "a b c" -> ["a", "b", "c"] => staticClass: ["a", "b", "c"]
5250
// "a {{x}} c" -> ["a", x, "c"] => classBinding: '["a", x, "c"]'
5351
let dynamic = false

0 commit comments

Comments
 (0)