-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
丁一鸣
authored and
丁一鸣
committed
Nov 20, 2015
1 parent
be703fa
commit 9244676
Showing
2 changed files
with
219 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title>父子组件传毒数据 用Props</title> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<meta http-equiv="x-ua-compatible" content="ie=edge"> | ||
<link rel="stylesheet" href="assets/boot4/bootstrap.min.css"> | ||
<link rel="stylesheet" href="assets/css/css/base.css"> | ||
</head> | ||
<body> | ||
<div id="demo"> | ||
<child msg="hello!xxx"></child> | ||
</div> | ||
|
||
<script src="assets/boot4/jquery.min.js"></script> | ||
<script src="assets/boot4/bootstrap.min.js"></script> | ||
<script src="assets/vuejs/vue.min.js"></script> | ||
|
||
<script> | ||
Vue.component('child',{ | ||
//声明props | ||
props:['msg'], | ||
|
||
//prop 可以用在模板内 | ||
//可以用 this.msg 设置 | ||
template : '<span>{{msg}}</span>' | ||
}) | ||
|
||
new Vue({ | ||
el:'#demo' | ||
}) | ||
</script> | ||
|
||
</body> | ||
</html> |