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
export default Ember.Component.extend({ | |
attributeBindings: ['background:style'], | |
size: 'medium', | |
background: computed('user.[]', function() { | |
const email = this.get('user.email'); | |
const size = this.get('size'); | |
const defaultAvatar = `//www.gravatar.com/avatar/${md5(email)}.jpg`; | |
const avatar_path = this.get('user.avatar') ? this.get('user.avatar') : defaultAvatar; |
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
// most literally copied from https://github.com/preboot/angular-webpack/blob/master/webpack.config.js - view for reference | |
var webpack = require('webpack'); | |
var autoprefixer = require('autoprefixer'); | |
var HtmlWebpackPlugin = require('html-webpack-plugin'); | |
var ExtractTextPlugin = require('extract-text-webpack-plugin'); | |
var CopyWebpackPlugin = require('copy-webpack-plugin'); | |
/** | |
* Env | |
* Get npm lifecycle event to identify the environment |
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
declare module "*.vue" { | |
import Vue from "vue"; | |
import { ComponentOptions } from "vue"; | |
export default typeof Vue as ComponentOptions<Vue>; | |
} |
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
/** | |
* Static vuex typings copied from ones included in node_modules. | |
* | |
* We need to do this in order to get typings for this.$store in components. | |
* Once this Feature is added, we can remove this + the custom mapping in tsconfig.json | |
* https://github.com/vuejs/vuex/issues/994 | |
*/ | |
import Vue, { WatchOptions } from 'vue'; | |
type Dictionary<T> = { [key: string]: T }; |
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
[Thu Nov 09 2017 15:23:28 GMT-0500 (EST)] DEBUG Mounting folder `/Users/e006707/Projects/test-project/dist` at `/` | |
[Thu Nov 09 2017 15:23:28 GMT-0500 (EST)] INFO Static server running at http://localhost:8081 | |
Debugger listening on [::]:5859 | |
[15:23:32] COMMAND POST "/wd/hub/session" | |
[15:23:32] DATA {"desiredCapabilities":{"javascriptEnabled":true,"locationContextEnabled":true,"handlesAlerts":true,"rotatable":true,"browser":"chrome","browserstack.debug":"true","browserstack.local":"true","browserName":"firefox","loggingPrefs":{"browser":"ALL","driver":"ALL"},"requestOrigins":{"url":"http://webdriver.io","version":"4.9.5","name":"webdriverio"}}} | |
[15:23:37] INFO SET SESSION ID 580859e74c3200e092d47c6173618125eabd9b32 | |
[15:23:37] RESULT {"applicationCacheEnabled":false,"rotatable":false,"mobileEmulationEnabled":false,"networkConnectionEnabled":false,"chrome":{"chromedriverVersion":"2.33.506120 (e3e53437346286c0bc2d2dc9aa4915ba81d9023f)","userDataDir":"C:\\Windows\\pro |
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
import Vue from 'vue' | |
import { getStoreBuilder } from 'vuex-typex'; | |
import Vuex, { Store } from 'vuex' | |
import { UserModule } from "./userModule"; | |
export interface RootState { | |
user: UserModule; | |
} | |
Vue.use(Vuex); |
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
<script lang="ts"> | |
import Vue from "vue" | |
interface TestComponentData { | |
testingProp: string | |
theme: "white" | "red" | |
} | |
export default Vue.extend({ | |
data() { |
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
Feature | vue-class-component | Vue.extend | |
---|---|---|---|
Autocomplete For Component Props In Templates | x | ✅ | |
Type-safety for Props | ✅ | x | |
Type-safety for Data Properties | ✅ | ✅ | |
Type-safety for Computed Properties | ✅ | ✅ | |
Type-safety for Methods | ✅ | ✅ |
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
<script lang="ts"> | |
import Component from "vue-class-component" | |
import { Prop } from "vue-property-decorator" | |
type ComplexObjectInterface = { | |
testProp: string | |
modelName: number | |
} | |
@Component |
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
<script lang="ts"> | |
import Vue, { PropTypes } from "vue" | |
type ComplexObjectInterface = { | |
testProp: string | |
modelName: number | |
} | |
export default Vue.extend({ | |
props: { |
OlderNewer