8000 Clarify v-html usage by lloy0076 · Pull Request #905 · vuejs/v2.vuejs.org · GitHub
[go: up one dir, main page]

Skip to content

Clarify v-html usage #905

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 19, 2017
Merged

Clarify v-html usage #905

merged 2 commits into from
May 19, 2017

Conversation

lloy0076
Copy link
Contributor

Originally, I'd thought that:

<div v-html="rawHtml">This {{ some_html}}</div>

(where we might have vm.data.some_html='<b>hello</b>') ... would render something like:

hello

But instead we get:

Property or method "rawHtml" is not defined on the instance but referenced during render. Make sure to declare reactive data properties in the data option.

...if one is watching console errors.

My wording could be a little bit kludgy and others might be able to make it clearer but I think this may overcome some misunderstandings for those not familiar with vuejs.

lloy0076 and others added 2 commits May 13, 2017 06:33
Originally, I'd thought that:

```
<div v-html="rawHtml">This {{ some_html}}</div>
```

(where we might have `vm.data.some_html='<b>hello</b>'`) ... would render something like:

**hello**

But instead we get:

```
Property or method "rawHtml" is not defined on the instance but referenced during render. Make sure to declare reactive data properties in the data option.
```

...if one is watching console errors.

My wording could be a little bit kludgy and others might be able to make it clearer but I think this may overcome some misunderstandings for those not familiar with vuejs.
@chrisvfritz chrisvfritz changed the title Update syntax.md Clarify v-html usage May 19, 2017
@chrisvfritz
Copy link
Contributor

Thanks! Just made a small update to the wording.

@chrisvfritz chrisvfritz merged commit 84a65b1 into vuejs:master May 19, 2017
@lloy0076 lloy0076 deleted the patch-2 branch May 19, 2017 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0