Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<template>
<p>{{ greeting }} World!</p>
</template>
<script>
module.exports = {
data: function () {
return {
greeting: 'Hello'
}
}
}
</script>
<style scoped>
p {
font-size: 2em;
text-align: center;
}
</style>
@agalligani

This comment has been minimized.

Copy link

@agalligani agalligani commented Aug 8, 2018

Thanks

@stephenlb

This comment has been minimized.

Copy link

@stephenlb stephenlb commented Sep 6, 2018

👍

@Rudzix77

This comment has been minimized.

Copy link

@Rudzix77 Rudzix77 commented Sep 12, 2018

That's silly question, but I suppose that screenshot on Vue's website is from you, could you tell me what syntax template do you use?

@jeoffAtLs

This comment has been minimized.

Copy link

@jeoffAtLs jeoffAtLs commented Oct 25, 2018

Can you give an example of how to use this file in an app? All of the other documentation in the guide on vuejs.org shows that you create components like:
var ComponentA = { /* ... / }
or
Vue.component('MyComponentName', { /
... */ })

then you can reference them by name, but in this file i don't see a component name or does it just come from the file name?

@jfbrennan

This comment has been minimized.

Copy link

@jfbrennan jfbrennan commented Nov 21, 2018

Where is the component tag name defined? is it taken from the file name, so to use the above I would write <hello></hello>?

@phillt

This comment has been minimized.

Copy link

@phillt phillt commented Dec 8, 2018

Where is the component tag name defined? is it taken from the file name, so to use the above I would write <hello></hello>?

I'm going to take a wild guess and say its whatever you export it as. So if its exported as default then it's whatever you name it on the import.

@yaogengzhu

This comment has been minimized.

Copy link

@yaogengzhu yaogengzhu commented Feb 18, 2019

goods

@qukezhi

This comment has been minimized.

Copy link

@qukezhi qukezhi commented Mar 28, 2019

Hello vue!

@qqlcx5

This comment has been minimized.

Copy link

@qqlcx5 qqlcx5 commented Jul 4, 2019

这。。。。
good star

@teelomo

This comment has been minimized.

Copy link

@teelomo teelomo commented Oct 25, 2019

six six six

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.