Skip to content
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

Cannot find template element #18

Open
nickofthyme opened this issue Aug 27, 2017 · 0 comments
Open

Cannot find template element #18

nickofthyme opened this issue Aug 27, 2017 · 0 comments

Comments

@nickofthyme
Copy link

Firstly, thanks for your effort on this, I love the idea of this component.

I found a problem with the way you pass the template prop to the vuep component referencing the string of code to render or the querySelection string to find the script tag of the code to render.

I keep getting an error that it can't be found because you are trying to querySelect the template element before it's even mounted. You need to change this to be done in mounted not created for vue to find that template element.

image

props: {
template: String,
options: {},
keepData: Boolean,
value: String
},

created () {
/* istanbul ignore next */
if (this.$isServer) return
let content = this.template
if (/^[\.#]/.test(this.template)) {
const html = document.querySelector(this.template)
if (!html) throw Error(`${this.template} is not found`)

Line 77 will never find the template on the dom

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

No branches or pull requests

1 participant