Skip to content

Commit

Permalink
vuejs
Browse files Browse the repository at this point in the history
-- build vue app
  • Loading branch information
dmitry-kurmanov committed Feb 1, 2017
1 parent fcb4a13 commit ea0a6dd
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 56 deletions.
2 changes: 1 addition & 1 deletion src/entries/vue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ export {defaultStandardCss} from "../defaultCss/cssstandard";
// css bootstrap
export {defaultBootstrapCss} from "../defaultCss/cssbootstrap";

export {Survey} from "../vue/vueSurvey";
export * from "../vue/vueSurvey.vue";
4 changes: 4 additions & 0 deletions src/vue/sfc.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare module "*.vue" {
import Vue = require('vue')
export default typeof Vue
}
70 changes: 17 additions & 53 deletions src/vue/vueSurvey.vue
Original file line number Diff line number Diff line change
@@ -1,56 +1,20 @@
import Vue from 'vue';
import Component from 'vue-class-component';
<template>
<div>{{model.questions[0].name}}</div>
</template>

import {surveyCss} from "../defaultCss/cssstandard";
import {QuestionBase} from "../questionbase";
import {SurveyPageId} from "../base";
<script lang="ts">
import * as Vue from 'vue'
import Component from 'vue-class-component'
import {VueSurveyModel} from "./vueSurveyModel";
/*
import {SurveyPage} from "./reactpage";
import {SurveyNavigation} from "./reactSurveyNavigation";
import {ISurveyCreator} from "./reactquestion";
import {ReactQuestionFactory} from "./reactquestionfactory";
import {SurveyProgress} from "./reactSurveyProgress";
*/

@Component({
props: {
json: Object
},
template: '<div>{{model.questions[0].name}}</div>'
})
export class Survey extends Vue {
model: VueSurveyModel;

constructor () {
super();
this.model = new VueSurveyModel(this.json);
@Component({
props: {
json: Object
}
})
export class Survey extends Vue {
json: Object;
constructor () {
super();
}
}
}

// @Component({
// // сюда можно помещать все опции компонента
// template: '<button @click="onClick">Click!</button>'
// })
// export class Survey extends Vue {
// // computed
// static get computedMsg () {
// return 'computed ';
// }
//
// constructor () {
// super();
// }
//
// // Данные инициализации могут быть объявлены как свойства инстанса
// private message: string = 'Hello!';
// // Методы компонента могут быть объявлены как методы инстанса
// onClick (): void {
// window.alert(this.message)
// }
//
// public renderError(): string {
// return "survey error";
// }
// }
</script>
File renamed without changes.
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"compilerOptions": {
"target": "es5",
"module": "es2015",
"lib": ["DOM","ES5","ES2015.Promise"],
"sourceMap": true,
"noImplicitAny": false,
"importHelpers": true,
Expand Down
4 changes: 2 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ module.exports = function(options) {
var config = {
entry: {},
resolve: {
extensions: ['.ts', '.tsx', '.scss']
extensions: ['.ts', '.js', '.tsx', '.scss']
},
module: {
rules: [
Expand All @@ -159,7 +159,7 @@ module.exports = function(options) {
'outDir': packagePath + 'typings/'
},
appendTsSuffixTo: [/\.vue$/]
}
}
},
{
test: /\.vue$/,
Expand Down

0 comments on commit ea0a6dd

Please sign in to comment.