Skip to content

Commit 6cc3c7a

Browse files
authored
add staticClass and style to migration guide (#566)
From vuejs/core#2248
1 parent a0640c1 commit 6cc3c7a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/guide/migration/render-function-api.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,10 @@ In 2.x, `domProps` contained a nested list within the VNode props:
103103
```js
104104
// 2.x
105105
{
106-
class: ['button', 'is-outlined'],
107-
style: { color: '#34495E' },
106+
staticClass: 'button',
107+
class: {'is-outlined': isOutlined },
108+
staticStyle: { color: '#34495E' },
109+
style: { backgroundColor: buttonColor },
108110
attrs: { id: 'submit' },
109111
domProps: { innerHTML: '' },
110112
on: { click: submitForm },
@@ -119,8 +121,8 @@ In 3.x, the entire VNode props structure is flattened. Using the example from ab
119121
```js
120122
// 3.x Syntax
121123
{
122-
class: ['button', 'is-outlined'],
123-
style: { color: '#34495E' },
124+
class: ['button', { 'is-outlined': isOutlined }],
125+
style: [{ color: '#34495E' }, { backgroundColor: buttonColor }],
124126
id: 'submit',
125127
innerHTML: '',
126128
onClick: submitForm,

0 commit comments

Comments
 (0)