-
Notifications
You must be signed in to change notification settings - Fork 3
/
sample-vuejs.aspx
36 lines (32 loc) · 967 Bytes
/
sample-vuejs.aspx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<%@ Page Language="C#" %>
<%@ Register Assembly="VueJSWebForms" Namespace="VueJSWebForms" TagPrefix="vue" %>
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
<vue:Component Name="car" Options="{props: ['make','year']}" runat="server">
<li>This {{make}} is {{(new Date()).getFullYear() - year}} years old.</li>
</vue:Component>
<vue:App runat="server">
<template>
<div>
<h1>{{title}}</h1>
<p>Today is: <%:DateTime.Now.ToLongDateString()%></p>
<ul>
<car v-for="car in cars" :make="car.Make" :year="car.Year" />
</ul>
</div>
</template>
<script>
export default {
data: { title: 'Age of cars',
cars: [{ Make: 'Buick', Year:2001 },
{ Make: 'Pontiac', Year:1998 },
{ Make: 'BMW', Year:2003 },
{ Make: 'Nissan', Year:2015 }]}
}
</script>
</vue:App>
</body>
</html>