indios / vue-ts-decorate Goto Github PK
View Code? Open in Web Editor NEWA set of TypeScript decorators for make the work with Vue.js easiest.
License: MIT License
A set of TypeScript decorators for make the work with Vue.js easiest.
License: MIT License
I know this is an exact duplicate of #1, but this still doesn't seem to be fixed even though the issue has been closed.
For me, it's the at-loader (awesome-typescript-loader
package) which complains during webpack build. The typings itself are not included within the current version of the npm package (1.0.0), but even after I downloaded them myself from the repo and included the file in tsconfig.json
, the error still persists.
error message
ERROR in [at-loader] ./node_modules/vue-ts-decorate/utils/tools.ts:149:20
TS2503: Cannot find namespace 'himalayajs'.
ERROR in [at-loader] ./node_modules/vue-ts-decorate/utils/tools.ts:167:23
TS2503: Cannot find namespace 'absurdCss'.
env
Node: 6.10.3
Vue: 2.3.3
ts: 2.3.2
Hi! I can't compile project with your library. My package.json:
...
"dependencies": {
"vue": "^2.1.10",
"vue-router": "^2.1.1",
"vuex": "^2.1.2"
},
"devDependencies": {
"@types/node": "^7.0.0",
"autoprefixer": "^6.7.4",
"css-loader": "^0.26.1",
"file-loader": "^0.10.0",
"html-loader": "^0.4.4",
"node-sass": "^4.5.0",
"sass-loader": "^6.0.0",
"ts-loader": "^2.0.0",
"typescript": "^2.1.6",
"url-loader": "^0.5.7",
"vue-ts-decorate": "^1.0.0",
"webpack": "^2.2.1"
},
When I compile it with webpack I've following errors:
$ webpack
...
ERROR in /projects/.../node_modules/vue-ts-decorate/utils/tools.ts
(149,20): error TS2503: Cannot find namespace 'himalayajs'.
ERROR in /projects/.../node_modules/vue-ts-decorate/utils/tools.ts
(167,23): error TS2503: Cannot find namespace 'absurdCss'.
Any suggestions?
You have wrong default value for router
option here.
If I have <router-view>
components in my template it makes me following error:
Uncaught TypeError: this._router.init is not a function
beforeCreate @ vue-router.common.js:421
callHook @ vue.common.js:2754
Vue._init @ vue.common.js:3377
VueComponent @ vue.common.js:3500
createComponentInstanceForVnode @ vue.common.js:1724
init @ vue.common.js:1734
(anonymous function) @ vue.common.js:1894
createComponent @ vue.common.js:4174
createElm @ vue.common.js:4117
createChildren @ vue.common.js:4242
createElm @ vue.common.js:4150
patch @ vue.common.js:4569
Vue._update @ vue.common.js:2635
updateComponent @ vue.common.js:2609
get @ vue.common.js:2934
Watcher @ vue.common.js:2926
Vue._mount @ vue.common.js:2608
Vue$3.$mount @ vue.common.js:6178
Vue$3.$mount @ vue.common.js:8549
init @ vue.common.js:1740
createComponent @ vue.common.js:4174
createElm @ vue.common.js:4117
patch @ vue.common.js:4605
Vue._update @ vue.common.js:2635
updateComponent @ vue.common.js:2609
get @ vue.common.js:2934
Watcher @ vue.common.js:2926
Vue._mount @ vue.common.js:2608
Vue$3.$mount @ vue.common.js:6178
Vue$3.$mount @ vue.common.js:8549
(anonymous function) @ main.ts:46
__webpack_require__ @ bootstrap a311129…:19
(anonymous function) @ bootstrap a311129…:65
(anonymous function) @ bootstrap a311129…:65
After some digging I found that VueRouter init() function expects that if router
in options that it should be a VueRouter instance that have init
method. See here. But you set this option to empty object if router
is not setted in options that cause above error. After deleting line #57 in your utilities.ts all works fine.
Is it somehow possible to use full class-functionality for filters?
i.e. I want to create helper functions inside my filter.
@Filter('myFilter')
export class MyFilter {
public filter(value: any, ...params: any[]) {
this.helperClass(value); // --> not working
}
helperClass(value) { /* ... */ }
}
Is there any chance to get this working?
Doesn't work with static functions either.
Thanks,
janein
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.