Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

Commit 0df6dd5

Browse files
author
Evan You
committed
init
0 parents  commit 0df6dd5

9 files changed

+7369
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_Store

.npmignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.*
2+
*.md
3+
*.json
4+
example

bower.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "vue-element",
3+
"version": "1.0.0",
4+
"description": "register a custom element with Vue.js.",
5+
"main": "vue-element.js",
6+
"authors": ["Evan You <yyx990803@gmail.com>"],
7+
"license": "MIT",
8+
"ignore": [
9+
".*",
10+
"*.md",
11+
"*.json",
12+
"example"
13+
]
14+
}

component.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "vue-element",
3+
"version": "1.0.0",
4+
"description": "register a custom element with Vue.js.",
5+
"main": "vue-element.js",
6+
"keywords": [
7+
"vue",
8+
"custom-elements"
9+
],
10+
"author": "Evan You",
11+
"license": "MIT",
12+
"scripts": [
13+
"vue-element.js"
14+
]
15+
}

example/example.html

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Vue.element example</title>
6+
<script src="platform.js"></script>
7+
<script src="vue-0.11.0-rc.js"></script>
8+
<script src="../vue-element.js"></script>
9+
</head>
10+
<body>
11+
12+
<my-element msg="custom message">
13+
original content
14+
</my-element>
15+
16+
<script>
17+
/**
18+
* Usage example, exactly the same with Vue.component,
19+
* except it's a real custom element (in supported browsers)
20+
*/
21+
Vue.element('my-element', {
22+
template:
23+
'<h1>This is a Vue custom element!</h1>' +
24+
'<h2>{{msg}}</h2>' +
25+
'<content></content>',
26+
paramAttributes: ['msg'],
27+
data: function () {
28+
return {
29+
msg: 'default message'
30+
}
31+
},
32+
attached: function () {
33+
console.log('attached!')
34+
},
35+
detached: function () {
36+
console.log('detached!')
37+
}
38+
})
39+
</script>
40+
</body>
41+
</html>

example/platform.js

+17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)