├── .gitignore ├── LICENSE ├── README.md ├── VueTypescriptVS.sln └── VueTypescriptVS ├── .babelrc ├── .gitignore ├── App_Start ├── BundleConfig.cs ├── FilterConfig.cs └── RouteConfig.cs ├── Controllers └── HomeController.cs ├── Global.asax ├── Global.asax.cs ├── Properties └── AssemblyInfo.cs ├── Scripts └── src │ ├── components │ ├── Demo.js │ ├── Demo.js.map │ ├── Demo.ts │ ├── Demo.vue │ ├── greeting.js │ ├── greeting.js.map │ └── greeting.ts │ ├── index.js │ ├── index.js.map │ ├── index.ts │ ├── lib │ └── vue-class-component │ │ ├── component.js │ │ ├── component.js.map │ │ ├── component.ts │ │ ├── data.js │ │ ├── data.js.map │ │ ├── data.ts │ │ ├── declarations.js │ │ ├── declarations.js.map │ │ ├── declarations.ts │ │ ├── globals.d.ts │ │ ├── index.js │ │ ├── index.js.map │ │ ├── index.ts │ │ ├── util.js │ │ ├── util.js.map │ │ └── util.ts │ └── typings │ ├── index.d.ts │ └── vue │ ├── index.d.ts │ ├── options.d.ts │ ├── plugin.d.ts │ ├── typings.json │ ├── vnode.d.ts │ └── vue.d.ts ├── Startup.cs ├── Views ├── Home │ └── Index.cshtml ├── Shared │ ├── Error.cshtml │ ├── Lockout.cshtml │ └── _Layout.cshtml ├── Web.config └── _ViewStart.cshtml ├── VueTypescriptVS.csproj ├── Web.Debug.config ├── Web.Release.config ├── Web.config ├── favicon.ico ├── index.html ├── package.json ├── packages.config ├── tsconfig.json └── webpack.config.js /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | artifacts/ 46 | 47 | *_i.c 48 | *_p.c 49 | *_i.h 50 | *.ilk 51 | *.meta 52 | *.obj 53 | *.pch 54 | *.pdb 55 | *.pgc 56 | *.pgd 57 | *.rsp 58 | *.sbr 59 | *.tlb 60 | *.tli 61 | *.tlh 62 | *.tmp 63 | *.tmp_proj 64 | *.log 65 | *.vspscc 66 | *.vssscc 67 | .builds 68 | *.pidb 69 | *.svclog 70 | *.scc 71 | 72 | # Chutzpah Test files 73 | _Chutzpah* 74 | 75 | # Visual C++ cache files 76 | ipch/ 77 | *.aps 78 | *.ncb 79 | *.opendb 80 | *.opensdf 81 | *.sdf 82 | *.cachefile 83 | *.VC.db 84 | *.VC.VC.opendb 85 | 86 | # Visual Studio profiler 87 | *.psess 88 | *.vsp 89 | *.vspx 90 | *.sap 91 | 92 | # TFS 2012 Local Workspace 93 | $tf/ 94 | 95 | # Guidance Automation Toolkit 96 | *.gpState 97 | 98 | # ReSharper is a .NET coding add-in 99 | _ReSharper*/ 100 | *.[Rr]e[Ss]harper 101 | *.DotSettings.user 102 | 103 | # JustCode is a .NET coding add-in 104 | .JustCode 105 | 106 | # TeamCity is a build add-in 107 | _TeamCity* 108 | 109 | # DotCover is a Code Coverage Tool 110 | *.dotCover 111 | 112 | # NCrunch 113 | _NCrunch_* 114 | .*crunch*.local.xml 115 | nCrunchTemp_* 116 | 117 | # MightyMoose 118 | *.mm.* 119 | AutoTest.Net/ 120 | 121 | # Web workbench (sass) 122 | .sass-cache/ 123 | 124 | # Installshield output folder 125 | [Ee]xpress/ 126 | 127 | # DocProject is a documentation generator add-in 128 | DocProject/buildhelp/ 129 | DocProject/Help/*.HxT 130 | DocProject/Help/*.HxC 131 | DocProject/Help/*.hhc 132 | DocProject/Help/*.hhk 133 | DocProject/Help/*.hhp 134 | DocProject/Help/Html2 135 | DocProject/Help/html 136 | 137 | # Click-Once directory 138 | publish/ 139 | 140 | # Publish Web Output 141 | *.[Pp]ublish.xml 142 | *.azurePubxml 143 | # TODO: Comment the next line if you want to checkin your web deploy settings 144 | # but database connection strings (with potential passwords) will be unencrypted 145 | *.pubxml 146 | *.publishproj 147 | 148 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 149 | # checkin your Azure Web App publish settings, but sensitive information contained 150 | # in these scripts will be unencrypted 151 | PublishScripts/ 152 | 153 | # NuGet Packages 154 | *.nupkg 155 | # The packages folder can be ignored because of Package Restore 156 | **/packages/* 157 | # except build/, which is used as an MSBuild target. 158 | !**/packages/build/ 159 | # Uncomment if necessary however generally it will be regenerated when needed 160 | #!**/packages/repositories.config 161 | # NuGet v3's project.json files produces more ignoreable files 162 | *.nuget.props 163 | *.nuget.targets 164 | 165 | # Microsoft Azure Build Output 166 | csx/ 167 | *.build.csdef 168 | 169 | # Microsoft Azure Emulator 170 | ecf/ 171 | rcf/ 172 | 173 | # Windows Store app package directories and files 174 | AppPackages/ 175 | BundleArtifacts/ 176 | Package.StoreAssociation.xml 177 | _pkginfo.txt 178 | 179 | # Visual Studio cache files 180 | # files ending in .cache can be ignored 181 | *.[Cc]ache 182 | # but keep track of directories ending in .cache 183 | !*.[Cc]ache/ 184 | 185 | # Others 186 | ClientBin/ 187 | ~$* 188 | *~ 189 | *.dbmdl 190 | *.dbproj.schemaview 191 | *.pfx 192 | *.publishsettings 193 | node_modules/ 194 | orleans.codegen.cs 195 | 196 | # Since there are multiple workflows, uncomment next line to ignore bower_components 197 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 198 | #bower_components/ 199 | 200 | # RIA/Silverlight projects 201 | Generated_Code/ 202 | 203 | # Backup & report files from converting an old project file 204 | # to a newer Visual Studio version. Backup files are not needed, 205 | # because we have git ;-) 206 | _UpgradeReport_Files/ 207 | Backup*/ 208 | UpgradeLog*.XML 209 | UpgradeLog*.htm 210 | 211 | # SQL Server files 212 | *.mdf 213 | *.ldf 214 | 215 | # Business Intelligence projects 216 | *.rdl.data 217 | *.bim.layout 218 | *.bim_*.settings 219 | 220 | # Microsoft Fakes 221 | FakesAssemblies/ 222 | 223 | # GhostDoc plugin setting file 224 | *.GhostDoc.xml 225 | 226 | # Node.js Tools for Visual Studio 227 | .ntvs_analysis.dat 228 | 229 | # Visual Studio 6 build log 230 | *.plg 231 | 232 | # Visual Studio 6 workspace options file 233 | *.opt 234 | 235 | # Visual Studio LightSwitch build output 236 | **/*.HTMLClient/GeneratedArtifacts 237 | **/*.DesktopClient/GeneratedArtifacts 238 | **/*.DesktopClient/ModelManifest.xml 239 | **/*.Server/GeneratedArtifacts 240 | **/*.Server/ModelManifest.xml 241 | _Pvt_Extensions 242 | 243 | # Paket dependency manager 244 | .paket/paket.exe 245 | paket-files/ 246 | 247 | # FAKE - F# Make 248 | .fake/ 249 | 250 | # JetBrains Rider 251 | .idea/ 252 | *.sln.iml 253 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Martin Vestergaard Nielsen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vue-typescript 2 | 3 | > A Vue.js project 4 | 5 | ## Build Setup 6 | 7 | ``` bash 8 | # install dependencies 9 | npm install 10 | 11 | # serve with hot reload at localhost:8080 12 | npm run dev 13 | 14 | # build for production with minification 15 | npm run build 16 | ``` 17 | 18 | For detailed explanation on how things work, consult the [docs for vue-loader](http://vuejs.github.io/vue-loader). 19 | -------------------------------------------------------------------------------- /VueTypescriptVS.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VueTypescriptVS", "VueTypescriptVS\VueTypescriptVS.csproj", "{20D6EB20-F8CB-4B61-A033-028365DB4E58}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {20D6EB20-F8CB-4B61-A033-028365DB4E58}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {20D6EB20-F8CB-4B61-A033-028365DB4E58}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {20D6EB20-F8CB-4B61-A033-028365DB4E58}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {20D6EB20-F8CB-4B61-A033-028365DB4E58}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /VueTypescriptVS/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["es2015", { "modules": false }] 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /VueTypescriptVS/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | dist/ 4 | npm-debug.log 5 | src/**/*.js 6 | -------------------------------------------------------------------------------- /VueTypescriptVS/App_Start/BundleConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Optimization; 3 | 4 | namespace VueTypescriptVS 5 | { 6 | public class BundleConfig 7 | { 8 | // For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862 9 | public static void RegisterBundles(BundleCollection bundles) 10 | { 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /VueTypescriptVS/App_Start/FilterConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Mvc; 3 | 4 | namespace VueTypescriptVS 5 | { 6 | public class FilterConfig 7 | { 8 | public static void RegisterGlobalFilters(GlobalFilterCollection filters) 9 | { 10 | filters.Add(new HandleErrorAttribute()); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /VueTypescriptVS/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace VueTypescriptVS 9 | { 10 | public class RouteConfig 11 | { 12 | public static void RegisterRoutes(RouteCollection routes) 13 | { 14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 15 | 16 | routes.MapRoute( 17 | name: "Default", 18 | url: "{controller}/{action}/{id}", 19 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } 20 | ); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /VueTypescriptVS/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | 7 | namespace VueTypescriptVS.Controllers 8 | { 9 | public class HomeController : Controller 10 | { 11 | public ActionResult Index() 12 | { 13 | return View(); 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /VueTypescriptVS/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="VueTypescriptVS.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /VueTypescriptVS/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Optimization; 7 | using System.Web.Routing; 8 | 9 | namespace VueTypescriptVS 10 | { 11 | public class MvcApplication : System.Web.HttpApplication 12 | { 13 | protected void Application_Start() 14 | { 15 | AreaRegistration.RegisterAllAreas(); 16 | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); 17 | RouteConfig.RegisterRoutes(RouteTable.Routes); 18 | BundleConfig.RegisterBundles(BundleTable.Bundles); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /VueTypescriptVS/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("VueTypescriptVS")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("VueTypescriptVS")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("c5dfd228-6850-4c00-bdcb-becfb316a683")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /VueTypescriptVS/Scripts/src/components/Demo.js: -------------------------------------------------------------------------------- 1 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 2 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 3 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 4 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 5 | return c > 3 && r && Object.defineProperty(target, key, r), r; 6 | }; 7 | import * as Vue from 'vue'; 8 | import Component from 'vue-class-component'; 9 | let Demo = class Demo extends Vue { 10 | }; 11 | Demo = __decorate([ 12 | Component({ 13 | props: ['name'] 14 | }) 15 | ], Demo); 16 | export default Demo; 17 | //# sourceMappingURL=Demo.js.map -------------------------------------------------------------------------------- /VueTypescriptVS/Scripts/src/components/Demo.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"Demo.js","sourceRoot":"","sources":["Demo.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAC3B,OAAO,SAAS,MAAM,qBAAqB,CAAC;AAK5C,IAAqB,IAAI,GAAzB,UAA0B,SAAQ,GAAG;CAAG,CAAA;AAAnB,IAAI;IAHxB,SAAS,CAAC;QACP,KAAK,EAAE,CAAC,MAAM,CAAC;KAClB,CAAC;GACmB,IAAI,CAAe;eAAnB,IAAI"} -------------------------------------------------------------------------------- /VueTypescriptVS/Scripts/src/components/Demo.ts: -------------------------------------------------------------------------------- 1 | import * as Vue from 'vue'; 2 | import Component from 'vue-class-component'; 3 | 4 | @Component({ 5 | props: ['name'] 6 | }) 7 | export default class Demo extends Vue {} -------------------------------------------------------------------------------- /VueTypescriptVS/Scripts/src/components/Demo.vue: -------------------------------------------------------------------------------- 1 |  4 | 5 | 8 | 9 | -------------------------------------------------------------------------------- /VueTypescriptVS/Scripts/src/components/greeting.js: -------------------------------------------------------------------------------- 1 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 2 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 3 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 4 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 5 | return c > 3 && r && Object.defineProperty(target, key, r), r; 6 | }; 7 | import * as Vue from 'vue'; 8 | import Component from 'vue-class-component'; 9 | // The @Component decorator indicates the class is a Vue component 10 | let Greeting = class Greeting extends Vue { 11 | }; 12 | Greeting = __decorate([ 13 | Component({ 14 | // All component options are allowed in here 15 | template: '

Hello {{ name }}

', 16 | props: ['name'], 17 | }) 18 | ], Greeting); 19 | export default Greeting; 20 | //# sourceMappingURL=greeting.js.map -------------------------------------------------------------------------------- /VueTypescriptVS/Scripts/src/components/greeting.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"greeting.js","sourceRoot":"","sources":["greeting.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAC3B,OAAO,SAAS,MAAM,qBAAqB,CAAC;AAE5C,kEAAkE;AAOlE,IAAqB,QAAQ,GAA7B,cAA8B,SAAQ,GAAG;CAAI,CAAA;AAAxB,QAAQ;IAN5B,SAAS,CAAC;QACV,4CAA4C;QAC5C,QAAQ,EAAE,2BAA2B;QAErC,KAAK,EAAE,CAAC,MAAM,CAAC;KACf,CAAC;GACmB,QAAQ,CAAgB;eAAxB,QAAQ"} -------------------------------------------------------------------------------- /VueTypescriptVS/Scripts/src/components/greeting.ts: -------------------------------------------------------------------------------- 1 | import * as Vue from 'vue'; 2 | import Component from 'vue-class-component'; 3 | 4 | // The @Component decorator indicates the class is a Vue component 5 | @Component({ 6 | // All component options are allowed in here 7 | template: '

Hello {{ name }}

', 8 | 9 | props: ['name'], 10 | }) 11 | export default class Greeting extends Vue { } -------------------------------------------------------------------------------- /VueTypescriptVS/Scripts/src/index.js: -------------------------------------------------------------------------------- 1 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 2 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 3 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 4 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 5 | return c > 3 && r && Object.defineProperty(target, key, r), r; 6 | }; 7 | import * as Vue from 'vue'; 8 | import Component from 'vue-class-component'; 9 | import Greeting from './components/greeting'; 10 | import Demo from './components/Demo.vue'; 11 | console.log(Demo); 12 | // The @Component decorator indicates the class is a Vue component 13 | let App = class App extends Vue { 14 | // The @Component decorator indicates the class is a Vue component 15 | constructor() { 16 | super(...arguments); 17 | // Initial data can be declared as instance properties 18 | this.userName = 'Hello!'; 19 | } 20 | // Component methods can be declared as instance methods 21 | reverse() { 22 | this.userName = this.userName.split('').reverse().join(''); 23 | } 24 | }; 25 | App = __decorate([ 26 | Component({ 27 | // All component options are allowed in here 28 | template: ` 29 |
30 | 31 | 32 | 33 | 34 |
35 | `, 36 | components: { 'greeting': Greeting, 'demo': Demo } 37 | }) 38 | ], App); 39 | new App({ el: '#app' }); 40 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /VueTypescriptVS/Scripts/src/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAC3B,OAAO,SAAS,MAAM,qBAAqB,CAAC;AAC5C,OAAO,QAAQ,MAAM,uBAAuB,CAAC;AAC7C,OAAO,IAAI,MAAM,uBAAuB,CAAC;AAEzC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;AAEjB,kEAAkE;AAclE,IAAM,GAAG,GAAT,SAAU,SAAQ,GAAG;IAdrB,kEAAkE;IAClE;;QAcC,sDAAsD;QACtD,aAAQ,GAAW,QAAQ,CAAC;IAK7B,CAAC;IAJA,wDAAwD;IACxD,OAAO;QACN,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACzD,CAAC;CACJ,CAAA;AAPK,GAAG;IAbR,SAAS,CAAC;QACV,4CAA4C;QAC5C,QAAQ,EAAE;;;;;;;EAOT;QAED,UAAU,EAAE,EAAE,UAAU,EAAG,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE;KACnD,CAAC;GACI,GAAG,CAOR;AAED,IAAI,GAAG,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC"} -------------------------------------------------------------------------------- /VueTypescriptVS/Scripts/src/index.ts: -------------------------------------------------------------------------------- 1 | import * as Vue from 'vue'; 2 | import Component from 'vue-class-component'; 3 | import Greeting from './components/greeting'; 4 | import Demo from './components/Demo.vue'; 5 | 6 | console.log(Demo) 7 | 8 | // The @Component decorator indicates the class is a Vue component 9 | @Component({ 10 | // All component options are allowed in here 11 | template: ` 12 |
13 | 14 | 15 | 16 | 17 |
18 | `, 19 | 20 | components: { 'greeting' : Greeting, 'demo': Demo } 21 | }) 22 | class App extends Vue { 23 | // Initial data can be declared as instance properties 24 | userName: string = 'Hello!'; 25 | // Component methods can be declared as instance methods 26 | reverse(): void { 27 | this.userName = this.userName.split('').reverse().join(''); 28 | } 29 | } 30 | 31 | new App({ el: '#app' }); -------------------------------------------------------------------------------- /VueTypescriptVS/Scripts/src/lib/vue-class-component/component.js: -------------------------------------------------------------------------------- 1 | import * as Vue from 'vue'; 2 | import { collectDataFromConstructor } from './data'; 3 | export const $internalHooks = [ 4 | 'data', 5 | 'beforeCreate', 6 | 'created', 7 | 'beforeMount', 8 | 'mounted', 9 | 'beforeDestroy', 10 | 'destroyed', 11 | 'beforeUpdate', 12 | 'updated', 13 | 'activated', 14 | 'deactivated', 15 | 'render' 16 | ]; 17 | // Property, method and parameter decorators created by `createDecorator` helper 18 | // will enqueue functions that update component options for lazy processing. 19 | // They will be executed just before creating component constructor. 20 | export let $decoratorQueue = []; 21 | export function componentFactory(Component, options = {}) { 22 | options.name = options.name || Component._componentTag; 23 | // prototype props. 24 | const proto = Component.prototype; 25 | Object.getOwnPropertyNames(proto).forEach(function (key) { 26 | if (key === 'constructor') { 27 | return; 28 | } 29 | // hooks 30 | if ($internalHooks.indexOf(key) > -1) { 31 | options[key] = proto[key]; 32 | return; 33 | } 34 | const descriptor = Object.getOwnPropertyDescriptor(proto, key); 35 | if (typeof descriptor.value === 'function') { 36 | // methods 37 | (options.methods || (options.methods = {}))[key] = descriptor.value; 38 | } 39 | else if (descriptor.get || descriptor.set) { 40 | // computed properties 41 | (options.computed || (options.computed = {}))[key] = { 42 | get: descriptor.get, 43 | set: descriptor.set 44 | }; 45 | } 46 | }); 47 | (options.mixins || (options.mixins = [])).push({ 48 | data() { 49 | return collectDataFromConstructor(this, Component); 50 | } 51 | }); 52 | // decorate options 53 | $decoratorQueue.forEach(fn => fn(options)); 54 | // reset for other component decoration 55 | $decoratorQueue = []; 56 | // find super 57 | const superProto = Object.getPrototypeOf(Component.prototype); 58 | const Super = superProto instanceof Vue 59 | ? superProto.constructor 60 | : Vue; 61 | return Super.extend(options); 62 | } 63 | //# sourceMappingURL=component.js.map -------------------------------------------------------------------------------- /VueTypescriptVS/Scripts/src/lib/vue-class-component/component.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"component.js","sourceRoot":"","sources":["component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAA;AAE1B,OAAO,EAAE,0BAA0B,EAAE,MAAM,QAAQ,CAAA;AAEnD,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,MAAM;IACN,cAAc;IACd,SAAS;IACT,aAAa;IACb,SAAS;IACT,eAAe;IACf,WAAW;IACX,cAAc;IACd,SAAS;IACT,WAAW;IACX,aAAa;IACb,QAAQ;CACT,CAAA;AAED,gFAAgF;AAChF,4EAA4E;AAC5E,oEAAoE;AACpE,MAAM,CAAC,IAAI,eAAe,GAAqD,EAAE,CAAA;AAEjF,MAAM,2BACJ,SAAmB,EACnB,UAAqC,EAAE;IAEvC,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,IAAK,SAAiB,CAAC,aAAa,CAAA;IAC/D,mBAAmB;IACnB,MAAM,KAAK,GAAG,SAAS,CAAC,SAAS,CAAA;IACjC,MAAM,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,UAAU,GAAG;QACrD,EAAE,CAAC,CAAC,GAAG,KAAK,aAAa,CAAC,CAAC,CAAC;YAC1B,MAAM,CAAA;QACR,CAAC;QACD,QAAQ;QACR,EAAE,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;YACrC,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAA;YACzB,MAAM,CAAA;QACR,CAAC;QACD,MAAM,UAAU,GAAG,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;QAC9D,EAAE,CAAC,CAAC,OAAO,UAAU,CAAC,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC;YAC3C,UAAU;YACV,CAAC,OAAO,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,KAAK,CAAA;QACrE,CAAC;QAAC,IAAI,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;YAC5C,sBAAsB;YACtB,CAAC,OAAO,CAAC,QAAQ,IAAI,CAAC,OAAO,CAAC,QAAQ,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG;gBACnD,GAAG,EAAE,UAAU,CAAC,GAAG;gBACnB,GAAG,EAAE,UAAU,CAAC,GAAG;aACpB,CAAA;QACH,CAAC;IACH,CAAC,CAAC,CAGD;IAAA,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QAC9C,IAAI;YACF,MAAM,CAAC,0BAA0B,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;QACpD,CAAC;KACF,CAAC,CAAA;IAEF,mBAAmB;IACnB,eAAe,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,OAAO,CAAC,CAAC,CAAA;IAC1C,uCAAuC;IACvC,eAAe,GAAG,EAAE,CAAA;IAEpB,aAAa;IACb,MAAM,UAAU,GAAG,MAAM,CAAC,cAAc,CAAC,SAAS,CAAC,SAAS,CAAC,CAAA;IAC7D,MAAM,KAAK,GAAG,UAAU,YAAY,GAAG;UACnC,UAAU,CAAC,WAAuB;UAClC,GAAG,CAAA;IACP,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;AAC9B,CAAC"} -------------------------------------------------------------------------------- /VueTypescriptVS/Scripts/src/lib/vue-class-component/component.ts: -------------------------------------------------------------------------------- 1 | import * as Vue from 'vue' 2 | import { VueClass } from './declarations' 3 | import { collectDataFromConstructor } from './data' 4 | 5 | export const $internalHooks = [ 6 | 'data', 7 | 'beforeCreate', 8 | 'created', 9 | 'beforeMount', 10 | 'mounted', 11 | 'beforeDestroy', 12 | 'destroyed', 13 | 'beforeUpdate', 14 | 'updated', 15 | 'activated', 16 | 'deactivated', 17 | 'render' 18 | ] 19 | 20 | // Property, method and parameter decorators created by `createDecorator` helper 21 | // will enqueue functions that update component options for lazy processing. 22 | // They will be executed just before creating component constructor. 23 | export let $decoratorQueue: ((options: Vue.ComponentOptions) => void)[] = [] 24 | 25 | export function componentFactory ( 26 | Component: VueClass, 27 | options: Vue.ComponentOptions = {} 28 | ): VueClass { 29 | options.name = options.name || (Component as any)._componentTag 30 | // prototype props. 31 | const proto = Component.prototype 32 | Object.getOwnPropertyNames(proto).forEach(function (key) { 33 | if (key === 'constructor') { 34 | return 35 | } 36 | // hooks 37 | if ($internalHooks.indexOf(key) > -1) { 38 | options[key] = proto[key] 39 | return 40 | } 41 | const descriptor = Object.getOwnPropertyDescriptor(proto, key) 42 | if (typeof descriptor.value === 'function') { 43 | // methods 44 | (options.methods || (options.methods = {}))[key] = descriptor.value 45 | } else if (descriptor.get || descriptor.set) { 46 | // computed properties 47 | (options.computed || (options.computed = {}))[key] = { 48 | get: descriptor.get, 49 | set: descriptor.set 50 | } 51 | } 52 | }) 53 | 54 | // add data hook to collect class properties as Vue instance's data 55 | ;(options.mixins || (options.mixins = [])).push({ 56 | data (this: Vue) { 57 | return collectDataFromConstructor(this, Component) 58 | } 59 | }) 60 | 61 | // decorate options 62 | $decoratorQueue.forEach(fn => fn(options)) 63 | // reset for other component decoration 64 | $decoratorQueue = [] 65 | 66 | // find super 67 | const superProto = Object.getPrototypeOf(Component.prototype) 68 | const Super = superProto instanceof Vue 69 | ? superProto.constructor as VueClass 70 | : Vue 71 | return Super.extend(options) 72 | } 73 | -------------------------------------------------------------------------------- /VueTypescriptVS/Scripts/src/lib/vue-class-component/data.js: -------------------------------------------------------------------------------- 1 | import * as Vue from 'vue'; 2 | import { warn } from './util'; 3 | export function collectDataFromConstructor(vm, Component) { 4 | // override _init to prevent to init as Vue instance 5 | Component.prototype._init = function () { 6 | // proxy to actual vm 7 | Object.getOwnPropertyNames(vm).forEach(key => { 8 | Object.defineProperty(this, key, { 9 | get: () => vm[key], 10 | set: value => vm[key] = value 11 | }); 12 | }); 13 | }; 14 | // should be acquired class property values 15 | const data = new Component(); 16 | // create plain data object 17 | const plainData = {}; 18 | Object.keys(data).forEach(key => { 19 | if (data[key] !== undefined) { 20 | plainData[key] = data[key]; 21 | } 22 | }); 23 | if (process.env.NODE_ENV !== 'production') { 24 | if (!(Component.prototype instanceof Vue) && Object.keys(plainData).length > 0) { 25 | warn('Component class must inherit Vue or its descendant class ' + 26 | 'when class property is used.'); 27 | } 28 | } 29 | return plainData; 30 | } 31 | //# sourceMappingURL=data.js.map -------------------------------------------------------------------------------- /VueTypescriptVS/Scripts/src/lib/vue-class-component/data.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"data.js","sourceRoot":"","sources":["data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAA;AAE1B,OAAO,EAAQ,IAAI,EAAE,MAAM,QAAQ,CAAA;AAEnC,MAAM,qCAAsC,EAAO,EAAE,SAAmB;IACtE,oDAAoD;IACpD,SAAS,CAAC,SAAS,CAAC,KAAK,GAAG;QAC1B,qBAAqB;QACrB,MAAM,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG;YACxC,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,EAAE;gBAC/B,GAAG,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC;gBAClB,GAAG,EAAE,KAAK,IAAI,EAAE,CAAC,GAAG,CAAC,GAAG,KAAK;aAC9B,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC,CAAA;IAED,2CAA2C;IAC3C,MAAM,IAAI,GAAG,IAAI,SAAS,EAAE,CAAA;IAE5B,2BAA2B;IAC3B,MAAM,SAAS,GAAG,EAAE,CAAA;IACpB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,GAAG;QAC3B,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC;YAC5B,SAAS,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAA;QAC5B,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC;QAC1C,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,YAAY,GAAG,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;YAC/E,IAAI,CACF,2DAA2D;gBAC3D,8BAA8B,CAC/B,CAAA;QACH,CAAC;IACH,CAAC;IAED,MAAM,CAAC,SAAS,CAAA;AAClB,CAAC"} -------------------------------------------------------------------------------- /VueTypescriptVS/Scripts/src/lib/vue-class-component/data.ts: -------------------------------------------------------------------------------- 1 | import * as Vue from 'vue' 2 | import { VueClass } from './declarations' 3 | import { noop, warn } from './util' 4 | 5 | export function collectDataFromConstructor (vm: Vue, Component: VueClass) { 6 | // override _init to prevent to init as Vue instance 7 | Component.prototype._init = function (this: Vue) { 8 | // proxy to actual vm 9 | Object.getOwnPropertyNames(vm).forEach(key => { 10 | Object.defineProperty(this, key, { 11 | get: () => vm[key], 12 | set: value => vm[key] = value 13 | }) 14 | }) 15 | } 16 | 17 | // should be acquired class property values 18 | const data = new Component() 19 | 20 | // create plain data object 21 | const plainData = {} 22 | Object.keys(data).forEach(key => { 23 | if (data[key] !== undefined) { 24 | plainData[key] = data[key] 25 | } 26 | }) 27 | 28 | if (process.env.NODE_ENV !== 'production') { 29 | if (!(Component.prototype instanceof Vue) && Object.keys(plainData).length > 0) { 30 | warn( 31 | 'Component class must inherit Vue or its descendant class ' + 32 | 'when class property is used.' 33 | ) 34 | } 35 | } 36 | 37 | return plainData 38 | } 39 | -------------------------------------------------------------------------------- /VueTypescriptVS/Scripts/src/lib/vue-class-component/declarations.js: -------------------------------------------------------------------------------- 1 | //# sourceMappingURL=declarations.js.map -------------------------------------------------------------------------------- /VueTypescriptVS/Scripts/src/lib/vue-class-component/declarations.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"declarations.js","sourceRoot":"","sources":["declarations.ts"],"names":[],"mappings":""} -------------------------------------------------------------------------------- /VueTypescriptVS/Scripts/src/lib/vue-class-component/declarations.ts: -------------------------------------------------------------------------------- 1 | import * as Vue from 'vue' 2 | 3 | export type VueClass = { new (): Vue } & typeof Vue 4 | -------------------------------------------------------------------------------- /VueTypescriptVS/Scripts/src/lib/vue-class-component/globals.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * global type declarations in this project 3 | * should not expose to userland 4 | */ 5 | 6 | declare const process: { 7 | env: { 8 | NODE_ENV: string 9 | } 10 | } -------------------------------------------------------------------------------- /VueTypescriptVS/Scripts/src/lib/vue-class-component/index.js: -------------------------------------------------------------------------------- 1 | import { componentFactory, $internalHooks } from './component'; 2 | export { createDecorator } from './util'; 3 | function Component(options) { 4 | if (typeof options === 'function') { 5 | return componentFactory(options); 6 | } 7 | return function (Component) { 8 | return componentFactory(Component, options); 9 | }; 10 | } 11 | (function (Component) { 12 | function registerHooks(keys) { 13 | $internalHooks.push(...keys); 14 | } 15 | Component.registerHooks = registerHooks; 16 | })(Component || (Component = {})); 17 | export default Component; 18 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /VueTypescriptVS/Scripts/src/lib/vue-class-component/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE9D,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAIxC,mBACC,OAAoC;IAEnC,EAAE,CAAC,CAAC,OAAO,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC;QAClC,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAA;IAClC,CAAC;IACD,MAAM,CAAC,UAAU,SAAY;QAC3B,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;IAC7C,CAAC,CAAA;AACH,CAAC;AAED,WAAU,SAAS;IACjB,uBAA+B,IAAc;QAC3C,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAA;IAC9B,CAAC;IAFe,uBAAa,gBAE5B,CAAA;AACH,CAAC,EAJS,SAAS,KAAT,SAAS,QAIlB;AAED,eAAe,SAAS,CAAA"} -------------------------------------------------------------------------------- /VueTypescriptVS/Scripts/src/lib/vue-class-component/index.ts: -------------------------------------------------------------------------------- 1 | import * as Vue from 'vue' 2 | import { VueClass } from './declarations' 3 | import { componentFactory, $internalHooks } from './component' 4 | 5 | export { createDecorator } from './util' 6 | 7 | function Component (options: Vue.ComponentOptions): (target: V) => V 8 | function Component (target: V): V 9 | function Component ( 10 | options: Vue.ComponentOptions | V 11 | ): any { 12 | if (typeof options === 'function') { 13 | return componentFactory(options) 14 | } 15 | return function (Component: V) { 16 | return componentFactory(Component, options) 17 | } 18 | } 19 | 20 | namespace Component { 21 | export function registerHooks (keys: string[]): void { 22 | $internalHooks.push(...keys) 23 | } 24 | } 25 | 26 | export default Component -------------------------------------------------------------------------------- /VueTypescriptVS/Scripts/src/lib/vue-class-component/util.js: -------------------------------------------------------------------------------- 1 | import { $decoratorQueue } from './component'; 2 | export const noop = () => { }; 3 | export function createDecorator(factory) { 4 | return (_, key, index) => { 5 | if (typeof index !== 'number') { 6 | index = undefined; 7 | } 8 | $decoratorQueue.push(options => factory(options, key, index)); 9 | }; 10 | } 11 | export function warn(message) { 12 | if (typeof console !== 'undefined') { 13 | console.warn('[vue-class-component] ' + message); 14 | } 15 | } 16 | //# sourceMappingURL=util.js.map -------------------------------------------------------------------------------- /VueTypescriptVS/Scripts/src/lib/vue-class-component/util.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"util.js","sourceRoot":"","sources":["util.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE7C,MAAM,CAAC,MAAM,IAAI,GAAG,QAAO,CAAC,CAAA;AAQ5B,MAAM,0BACJ,OAAiF;IAEjF,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK;QACnB,EAAE,CAAC,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC;YAC9B,KAAK,GAAG,SAAS,CAAA;QACnB,CAAC;QACD,eAAe,CAAC,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,CAAA;IAC/D,CAAC,CAAA;AACH,CAAC;AAED,MAAM,eAAgB,OAAe;IACnC,EAAE,CAAC,CAAC,OAAO,OAAO,KAAK,WAAW,CAAC,CAAC,CAAC;QACnC,OAAO,CAAC,IAAI,CAAC,wBAAwB,GAAG,OAAO,CAAC,CAAA;IAClD,CAAC;AACH,CAAC"} -------------------------------------------------------------------------------- /VueTypescriptVS/Scripts/src/lib/vue-class-component/util.ts: -------------------------------------------------------------------------------- 1 | import * as Vue from 'vue' 2 | import { $decoratorQueue } from './component' 3 | 4 | export const noop = () => {} 5 | 6 | export function createDecorator ( 7 | factory: (options: Vue.ComponentOptions, key: string) => void 8 | ): (target: Vue, key: string) => void 9 | export function createDecorator ( 10 | factory: (options: Vue.ComponentOptions, key: string, index: number) => void 11 | ): (target: Vue, key: string, index: number) => void 12 | export function createDecorator ( 13 | factory: (options: Vue.ComponentOptions, key: string, index: number) => void 14 | ): (target: Vue, key: string, index: any) => void { 15 | return (_, key, index) => { 16 | if (typeof index !== 'number') { 17 | index = undefined 18 | } 19 | $decoratorQueue.push(options => factory(options, key, index)) 20 | } 21 | } 22 | 23 | export function warn (message: string): void { 24 | if (typeof console !== 'undefined') { 25 | console.warn('[vue-class-component] ' + message) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /VueTypescriptVS/Scripts/src/typings/index.d.ts: -------------------------------------------------------------------------------- 1 |  2 | -------------------------------------------------------------------------------- /VueTypescriptVS/Scripts/src/typings/vue/index.d.ts: -------------------------------------------------------------------------------- 1 | import * as V from "./vue"; 2 | import * as Options from "./options"; 3 | import * as Plugin from "./plugin"; 4 | import * as VNode from "./vnode"; 5 | 6 | // `Vue` in `export = Vue` must be a namespace 7 | // All available types are exported via this namespace 8 | declare namespace Vue { 9 | export type CreateElement = V.CreateElement; 10 | 11 | export type Component = Options.Component; 12 | export type AsyncComponent = Options.AsyncComponent; 13 | export type ComponentOptions = Options.ComponentOptions; 14 | export type FunctionalComponentOptions = Options.FunctionalComponentOptions; 15 | export type RenderContext = Options.RenderContext; 16 | export type PropOptions = Options.PropOptions; 17 | export type ComputedOptions = Options.ComputedOptions; 18 | export type WatchHandler = Options.WatchHandler; 19 | export type WatchOptions = Options.WatchOptions; 20 | export type DirectiveFunction = Options.DirectiveFunction; 21 | export type DirectiveOptions = Options.DirectiveOptions; 22 | 23 | export type PluginFunction = Plugin.PluginFunction; 24 | export type PluginObject = Plugin.PluginObject; 25 | 26 | export type VNodeChildren = VNode.VNodeChildren; 27 | export type VNodeChildrenArrayContents = VNode.VNodeChildrenArrayContents; 28 | export type VNode = VNode.VNode; 29 | export type VNodeComponentOptions = VNode.VNodeComponentOptions; 30 | export type VNodeData = VNode.VNodeData; 31 | export type VNodeDirective = VNode.VNodeDirective; 32 | } 33 | 34 | // TS cannot merge imported class with namespace, declare a subclass to bypass 35 | declare class Vue extends V.Vue {} 36 | 37 | export = Vue; 38 | -------------------------------------------------------------------------------- /VueTypescriptVS/Scripts/src/typings/vue/options.d.ts: -------------------------------------------------------------------------------- 1 | import { Vue, CreateElement } from "./vue"; 2 | import { VNode, VNodeData, VNodeDirective } from "./vnode"; 3 | 4 | type Constructor = { 5 | new (...args: any[]): any; 6 | } 7 | 8 | export type Component = typeof Vue | ComponentOptions | FunctionalComponentOptions; 9 | export type AsyncComponent = ( 10 | resolve: (component: Component) => void, 11 | reject: (reason?: any) => void 12 | ) => Promise | Component | void; 13 | 14 | export interface ComponentOptions { 15 | data?: Object | ((this: V) => Object); 16 | props?: string[] | { [key: string]: PropOptions | Constructor | Constructor[] }; 17 | propsData?: Object; 18 | computed?: { [key: string]: ((this: V) => any) | ComputedOptions }; 19 | methods?: { [key: string]: (this: V, ...args: any[]) => any }; 20 | watch?: { [key: string]: ({ handler: WatchHandler } & WatchOptions) | WatchHandler | string }; 21 | 22 | el?: Element | String; 23 | template?: string; 24 | render?(this: V, createElement: CreateElement): VNode; 25 | staticRenderFns?: ((createElement: CreateElement) => VNode)[]; 26 | 27 | beforeCreate?(this: V): void; 28 | created?(this: V): void; 29 | beforeDestroy?(this: V): void; 30 | destroyed?(this: V): void; 31 | beforeMount?(this: V): void; 32 | mounted?(this: V): void; 33 | beforeUpdate?(this: V): void; 34 | updated?(this: V): void; 35 | activated?(this: V): void; 36 | deactivated?(this: V): void; 37 | 38 | directives?: { [key: string]: DirectiveOptions | DirectiveFunction }; 39 | components?: { [key: string]: Component | AsyncComponent }; 40 | transitions?: { [key: string]: Object }; 41 | filters?: { [key: string]: Function }; 42 | 43 | parent?: Vue; 44 | mixins?: (ComponentOptions | typeof Vue)[]; 45 | name?: string; 46 | extends?: ComponentOptions | typeof Vue; 47 | delimiters?: [string, string]; 48 | } 49 | 50 | export interface FunctionalComponentOptions { 51 | props?: string[] | { [key: string]: PropOptions | Constructor | Constructor[] }; 52 | functional: boolean; 53 | render(this: never, createElement: CreateElement, context: RenderContext): VNode; 54 | name?: string; 55 | } 56 | 57 | export interface RenderContext { 58 | props: any; 59 | children: VNode[]; 60 | slots(): any; 61 | data: VNodeData; 62 | parent: Vue; 63 | } 64 | 65 | export interface PropOptions { 66 | type?: Constructor | Constructor[] | null; 67 | required?: boolean; 68 | default?: any; 69 | validator?(value: any): boolean; 70 | } 71 | 72 | export interface ComputedOptions { 73 | get?(this: V): any; 74 | set?(this: V, value: any): void; 75 | cache?: boolean; 76 | } 77 | 78 | export type WatchHandler = (this: V, val: any, oldVal: any) => void; 79 | 80 | export interface WatchOptions { 81 | deep?: boolean; 82 | immediate?: boolean; 83 | } 84 | 85 | export type DirectiveFunction = ( 86 | el: HTMLElement, 87 | binding: VNodeDirective, 88 | vnode: VNode, 89 | oldVnode: VNode 90 | ) => void; 91 | 92 | export interface DirectiveOptions { 93 | bind?: DirectiveFunction; 94 | inserted?: DirectiveFunction; 95 | update?: DirectiveFunction; 96 | componentUpdated?: DirectiveFunction; 97 | unbind?: DirectiveFunction; 98 | } 99 | -------------------------------------------------------------------------------- /VueTypescriptVS/Scripts/src/typings/vue/plugin.d.ts: -------------------------------------------------------------------------------- 1 | import { Vue as _Vue } from "./vue"; 2 | 3 | export type PluginFunction = (Vue: typeof _Vue, options?: T) => void; 4 | 5 | export interface PluginObject { 6 | install: PluginFunction; 7 | [key: string]: any; 8 | } 9 | -------------------------------------------------------------------------------- /VueTypescriptVS/Scripts/src/typings/vue/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue", 3 | "main": "index.d.ts" 4 | } 5 | -------------------------------------------------------------------------------- /VueTypescriptVS/Scripts/src/typings/vue/vnode.d.ts: -------------------------------------------------------------------------------- 1 | import { Vue } from "./vue"; 2 | 3 | export type ScopedSlot = (props: any) => VNodeChildrenArrayContents | string; 4 | 5 | export type VNodeChildren = VNodeChildrenArrayContents | [ScopedSlot] | string; 6 | export interface VNodeChildrenArrayContents { 7 | [x: number]: VNode | string | VNodeChildren; 8 | } 9 | 10 | export interface VNode { 11 | tag?: string; 12 | data?: VNodeData; 13 | children?: VNode[]; 14 | text?: string; 15 | elm?: Node; 16 | ns?: string; 17 | context?: Vue; 18 | key?: string | number; 19 | componentOptions?: VNodeComponentOptions; 20 | child?: Vue; 21 | parent?: VNode; 22 | raw?: boolean; 23 | isStatic?: boolean; 24 | isRootInsert: boolean; 25 | isComment: boolean; 26 | } 27 | 28 | export interface VNodeComponentOptions { 29 | Ctor: typeof Vue; 30 | propsData?: Object; 31 | listeners?: Object; 32 | children?: VNodeChildren; 33 | tag?: string; 34 | } 35 | 36 | export interface VNodeData { 37 | key?: string | number; 38 | slot?: string; 39 | scopedSlots?: { [key: string]: ScopedSlot }; 40 | ref?: string; 41 | tag?: string; 42 | staticClass?: string; 43 | class?: any; 44 | staticStyle?: { [key: string]: any }; 45 | style?: Object[] | Object; 46 | props?: { [key: string]: any }; 47 | attrs?: { [key: string]: any }; 48 | domProps?: { [key: string]: any }; 49 | hook?: { [key: string]: Function }; 50 | on?: { [key: string]: Function | Function[] }; 51 | nativeOn?: { [key: string]: Function | Function[] }; 52 | transition?: Object; 53 | show?: boolean; 54 | inlineTemplate?: { 55 | render: Function; 56 | staticRenderFns: Function[]; 57 | }; 58 | directives?: VNodeDirective[]; 59 | keepAlive?: boolean; 60 | } 61 | 62 | export interface VNodeDirective { 63 | readonly name: string; 64 | readonly value: any; 65 | readonly oldValue: any; 66 | readonly expression: any; 67 | readonly arg: string; 68 | readonly modifiers: { [key: string]: boolean }; 69 | } 70 | -------------------------------------------------------------------------------- /VueTypescriptVS/Scripts/src/typings/vue/vue.d.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Component, 3 | AsyncComponent, 4 | ComponentOptions, 5 | FunctionalComponentOptions, 6 | WatchOptions, 7 | WatchHandler, 8 | DirectiveOptions, 9 | DirectiveFunction 10 | } from "./options"; 11 | import { VNode, VNodeData, VNodeChildren, ScopedSlot } from "./vnode"; 12 | import { PluginFunction, PluginObject } from "./plugin"; 13 | 14 | export type CreateElement = { 15 | // empty node 16 | (): VNode; 17 | 18 | // element or component name 19 | (tag: string, children: VNodeChildren): VNode; 20 | (tag: string, data?: VNodeData, children?: VNodeChildren): VNode; 21 | 22 | // component constructor or options 23 | (tag: Component, children: VNodeChildren): VNode; 24 | (tag: Component, data?: VNodeData, children?: VNodeChildren): VNode; 25 | 26 | // async component 27 | (tag: AsyncComponent, children: VNodeChildren): VNode; 28 | (tag: AsyncComponent, data?: VNodeData, children?: VNodeChildren): VNode; 29 | } 30 | 31 | export declare class Vue { 32 | 33 | constructor(options?: ComponentOptions); 34 | 35 | $data: Object; 36 | readonly $el: HTMLElement; 37 | readonly $options: ComponentOptions; 38 | readonly $parent: Vue; 39 | readonly $root: Vue; 40 | readonly $children: Vue[]; 41 | readonly $refs: { [key: string]: Vue | Element | Vue[] | Element[]}; 42 | readonly $slots: { [key: string]: VNode[] }; 43 | readonly $scopedSlots: { [key: string]: ScopedSlot }; 44 | readonly $isServer: boolean; 45 | 46 | $mount(elementOrSelector?: Element | String, hydrating?: boolean): this; 47 | $forceUpdate(): void; 48 | $destroy(): void; 49 | $set: typeof Vue.set; 50 | $delete: typeof Vue.delete; 51 | $watch( 52 | expOrFn: string | Function, 53 | callback: WatchHandler, 54 | options?: WatchOptions 55 | ): (() => void); 56 | $on(event: string, callback: Function): this; 57 | $once(event: string, callback: Function): this; 58 | $off(event?: string, callback?: Function): this; 59 | $emit(event: string, ...args: any[]): this; 60 | $nextTick(callback: (this: this) => void): void; 61 | $nextTick(): Promise; 62 | $createElement: CreateElement; 63 | 64 | static config: { 65 | silent: boolean; 66 | optionMergeStrategies: any; 67 | devtools: boolean; 68 | errorHandler(err: Error, vm: Vue): void; 69 | keyCodes: { [key: string]: number }; 70 | } 71 | 72 | static extend(options: ComponentOptions | FunctionalComponentOptions): typeof Vue; 73 | static nextTick(callback: () => void, context?: any[]): void; 74 | static nextTick(): Promise 75 | static set(object: Object, key: string, value: T): T; 76 | static set(array: T[], key: number, value: T): T; 77 | static delete(object: Object, key: string): void; 78 | 79 | static directive( 80 | id: string, 81 | definition?: DirectiveOptions | DirectiveFunction 82 | ): DirectiveOptions; 83 | static filter(id: string, definition?: Function): Function; 84 | static component(id: string, definition?: Component | AsyncComponent): typeof Vue; 85 | 86 | static use(plugin: PluginObject | PluginFunction, options?: T): void; 87 | static mixin(mixin: typeof Vue | ComponentOptions): void; 88 | static compile(template: string): { 89 | render(createElement: typeof Vue.prototype.$createElement): VNode; 90 | staticRenderFns: (() => VNode)[]; 91 | }; 92 | } 93 | -------------------------------------------------------------------------------- /VueTypescriptVS/Startup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Owin; 2 | using Owin; 3 | 4 | [assembly: OwinStartupAttribute(typeof(VueTypescriptVS.Startup))] 5 | namespace VueTypescriptVS 6 | { 7 | public partial class Startup 8 | { 9 | public void Configuration(IAppBuilder app) 10 | { 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /VueTypescriptVS/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Home Page"; 3 | } 4 | 5 |
-------------------------------------------------------------------------------- /VueTypescriptVS/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model System.Web.Mvc.HandleErrorInfo 2 | 3 | @{ 4 | ViewBag.Title = "Error"; 5 | } 6 | 7 |

Error.

8 |

An error occurred while processing your request.

9 | 10 | -------------------------------------------------------------------------------- /VueTypescriptVS/Views/Shared/Lockout.cshtml: -------------------------------------------------------------------------------- 1 | @model System.Web.Mvc.HandleErrorInfo 2 | 3 | @{ 4 | ViewBag.Title = "Locked Out"; 5 | } 6 | 7 |
8 |

Locked out.

9 |

This account has been locked out, please try again later.

10 |
11 | -------------------------------------------------------------------------------- /VueTypescriptVS/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | @ViewBag.Title - My ASP.NET Application 7 | 8 | 9 | 10 | 11 | @RenderBody() 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /VueTypescriptVS/Views/Web.config: -------------------------------------------------------------------------------- 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 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /VueTypescriptVS/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } 4 | -------------------------------------------------------------------------------- /VueTypescriptVS/VueTypescriptVS.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | Debug 9 | AnyCPU 10 | 11 | 12 | 2.0 13 | {20D6EB20-F8CB-4B61-A033-028365DB4E58} 14 | {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} 15 | Library 16 | Properties 17 | VueTypescriptVS 18 | VueTypescriptVS 19 | v4.5.2 20 | false 21 | true 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 2.1 30 | 31 | 32 | true 33 | full 34 | false 35 | bin\ 36 | DEBUG;TRACE 37 | prompt 38 | 4 39 | 40 | 41 | pdbonly 42 | true 43 | bin\ 44 | TRACE 45 | prompt 46 | 4 47 | 48 | 49 | 50 | ..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll 51 | True 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | True 74 | ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll 75 | 76 | 77 | 78 | 79 | 80 | 81 | True 82 | ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.Helpers.dll 83 | 84 | 85 | True 86 | ..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll 87 | 88 | 89 | ..\packages\Microsoft.AspNet.Web.Optimization.1.1.3\lib\net40\System.Web.Optimization.dll 90 | 91 | 92 | True 93 | ..\packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll 94 | 95 | 96 | True 97 | ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.dll 98 | 99 | 100 | True 101 | ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Deployment.dll 102 | 103 | 104 | True 105 | ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Razor.dll 106 | 107 | 108 | True 109 | ..\packages\WebGrease.1.5.2\lib\WebGrease.dll 110 | 111 | 112 | True 113 | ..\packages\Antlr.3.4.1.9004\lib\Antlr3.Runtime.dll 114 | 115 | 116 | 117 | 118 | ..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll 119 | 120 | 121 | ..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.dll 122 | 123 | 124 | ..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.SqlServer.dll 125 | 126 | 127 | ..\packages\Microsoft.AspNet.Identity.Core.2.2.1\lib\net45\Microsoft.AspNet.Identity.Core.dll 128 | 129 | 130 | ..\packages\Microsoft.AspNet.Identity.Owin.2.2.1\lib\net45\Microsoft.AspNet.Identity.Owin.dll 131 | 132 | 133 | ..\packages\Microsoft.AspNet.Identity.EntityFramework.2.2.1\lib\net45\Microsoft.AspNet.Identity.EntityFramework.dll 134 | 135 | 136 | ..\packages\Owin.1.0\lib\net40\Owin.dll 137 | 138 | 139 | ..\packages\Microsoft.Owin.3.0.1\lib\net45\Microsoft.Owin.dll 140 | 141 | 142 | ..\packages\Microsoft.Owin.Host.SystemWeb.3.0.1\lib\net45\Microsoft.Owin.Host.SystemWeb.dll 143 | 144 | 145 | ..\packages\Microsoft.Owin.Security.3.0.1\lib\net45\Microsoft.Owin.Security.dll 146 | 147 | 148 | ..\packages\Microsoft.Owin.Security.Facebook.3.0.1\lib\net45\Microsoft.Owin.Security.Facebook.dll 149 | 150 | 151 | ..\packages\Microsoft.Owin.Security.Cookies.3.0.1\lib\net45\Microsoft.Owin.Security.Cookies.dll 152 | 153 | 154 | ..\packages\Microsoft.Owin.Security.OAuth.3.0.1\lib\net45\Microsoft.Owin.Security.OAuth.dll 155 | 156 | 157 | ..\packages\Microsoft.Owin.Security.Google.3.0.1\lib\net45\Microsoft.Owin.Security.Google.dll 158 | 159 | 160 | ..\packages\Microsoft.Owin.Security.Twitter.3.0.1\lib\net45\Microsoft.Owin.Security.Twitter.dll 161 | 162 | 163 | ..\packages\Microsoft.Owin.Security.MicrosoftAccount.3.0.1\lib\net45\Microsoft.Owin.Security.MicrosoftAccount.dll 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | Global.asax 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | Web.config 194 | 195 | 196 | Web.config 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 10.0 240 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | True 254 | True 255 | 57848 256 | / 257 | http://localhost:57848/ 258 | False 259 | False 260 | 261 | 262 | False 263 | 264 | 265 | 266 | 267 | 268 | 269 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 270 | 271 | 272 | 273 | 274 | 280 | -------------------------------------------------------------------------------- /VueTypescriptVS/Web.Debug.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /VueTypescriptVS/Web.Release.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /VueTypescriptVS/Web.config: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /VueTypescriptVS/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature613/vue-webpack-typescript-vs2015/a067d5c2b179bd9ec7b8dc2e0ed4c3d1b1264b8c/VueTypescriptVS/favicon.ico -------------------------------------------------------------------------------- /VueTypescriptVS/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | vue-typescript 6 | 7 | 8 |
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /VueTypescriptVS/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-typescript", 3 | "description": "A Vue.js project", 4 | "version": "1.0.0", 5 | "author": "Martin V. Nielsen ", 6 | "private": true, 7 | "scripts": { 8 | "dev": "cross-env NODE_ENV=development webpack-dev-server --open --inline --hot", 9 | "build": "cross-env NODE_ENV=production webpack --progress --hide-modules" 10 | }, 11 | "dependencies": { 12 | "vue": "^2.1.0" 13 | }, 14 | "devDependencies": { 15 | "babel-core": "^6.0.0", 16 | "babel-loader": "^6.0.0", 17 | "babel-preset-es2015": "^6.0.0", 18 | "cross-env": "^3.0.0", 19 | "css-loader": "^0.25.0", 20 | "file-loader": "^0.9.0", 21 | "vue-class-component": "^4.4.0", 22 | "vue-loader": "^10.0.0", 23 | "vue-template-compiler": "^2.1.0", 24 | "vue-typescript-import-dts": "^3.0.1", 25 | "webpack": "^2.1.0-beta.25", 26 | "webpack-dev-server": "^2.1.0-beta.9" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /VueTypescriptVS/packages.config: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /VueTypescriptVS/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": true, 3 | "compilerOptions": { 4 | "experimentalDecorators": true, 5 | "noImplicitAny": false, 6 | "noEmitOnError": true, 7 | "removeComments": false, 8 | "allowJs": true, 9 | "sourceMap": true, 10 | "target": "es6", 11 | "module": "es6", 12 | "lib": [ 13 | "dom", 14 | "es2015", 15 | "es2015.promise" 16 | ], 17 | "types": [ "vue-typescript-import-dts" ], 18 | "baseUrl": ".", 19 | "paths": { 20 | "vue": [ "scripts/src/typings/vue/index" ], 21 | "vue-class-component": [ "scripts/src/lib/vue-class-component/index" ] 22 | } 23 | }, 24 | "include": [ 25 | "scripts/src" 26 | ] 27 | 28 | } 29 | -------------------------------------------------------------------------------- /VueTypescriptVS/webpack.config.js: -------------------------------------------------------------------------------- 1 | /// 2 | var path = require('path') 3 | var webpack = require('webpack') 4 | 5 | module.exports = { 6 | entry: './scripts/src/index.js', 7 | output: { 8 | path: path.resolve(__dirname, './scripts/dist'), 9 | publicPath: '/scripts/dist/', 10 | filename: 'build.js' 11 | }, 12 | module: { 13 | rules: [ 14 | { 15 | test: /\.vue$/, 16 | loader: 'vue-loader', 17 | options: { 18 | loaders: { 19 | // Since sass-loader (weirdly) has SCSS as its default parse mode, we map 20 | // the "scss" and "sass" values for the lang attribute to the right configs here. 21 | // other preprocessors should work out of the box, no loader config like this nessessary. 22 | 'scss': 'vue-style-loader!css-loader!sass-loader', 23 | 'sass': 'vue-style-loader!css-loader!sass-loader?indentedSyntax' 24 | } 25 | // other vue-loader options go here 26 | } 27 | }, 28 | { 29 | test: /\.js$/, 30 | loader: 'babel-loader', 31 | exclude: /node_modules/ 32 | }, 33 | { 34 | test: /\.(png|jpg|gif|svg)$/, 35 | loader: 'file-loader', 36 | options: { 37 | name: '[name].[ext]?[hash]' 38 | } 39 | } 40 | ] 41 | }, 42 | resolve: { 43 | alias: { 44 | 'vue$': 'vue/dist/vue.common.js', 45 | 'vue-class-component$': 'vue-class-component/dist/vue-class-component.common.js' 46 | } 47 | }, 48 | devServer: { 49 | historyApiFallback: true, 50 | noInfo: true 51 | }, 52 | performance: { 53 | hints: false 54 | }, 55 | devtool: '#eval-source-map' 56 | } 57 | 58 | if (process.env.NODE_ENV === 'production') { 59 | module.exports.devtool = '#source-map' 60 | // http://vue-loader.vuejs.org/en/workflow/production.html 61 | module.exports.plugins = (module.exports.plugins || []).concat([ 62 | new webpack.DefinePlugin({ 63 | 'process.env': { 64 | NODE_ENV: '"production"' 65 | } 66 | }), 67 | new webpack.optimize.UglifyJsPlugin({ 68 | sourceMap: true, 69 | compress: { 70 | warnings: false 71 | } 72 | }), 73 | new webpack.LoaderOptionsPlugin({ 74 | minimize: true 75 | }) 76 | ]) 77 | } 78 | --------------------------------------------------------------------------------