How to use the vue-property-decorator.Inject function in vue-property-decorator

To help you get started, we’ve selected a few vue-property-decorator examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dotnetcore / WTM / demo / WalkingTec.Mvvm.Next / ClientApp / packages / www-vue / src / components / pages / formItem.ts View on Github external
v-decorator="decorator" 
                           :dataSource="dataSource"
                           :Entitie="Entitie"
                        />
                    
                    <template>
                        ${CreateChildrenTemplate(item)}
                    </template>
                
            
        
        `,

    })
    class FieldItem extends Vue {
        @Inject('FieldsChangeSubject')
        private FieldsChange: Subject&lt;{
            props: any;
            fields: any;
            form: WrappedFormUtils;
        }&gt;;
        @Prop() private display: any;
        @Prop() private disabled: any;
        @Prop() private decoratorOptions: any;
        FieldsChangeSubscription: Subscription;
        Entitie = item;
        loadData = false;
        spinning = false;
        dataSource = [];
        // 计算属性的 getter
        get decorator() {
            const options = lodash.merge({}, item.options, this.decoratorOptions);
github yoyo930021 / vc2c / tests / fixture / Input.vue View on Github external
}
  }
})
export default class BasicPropertyClass extends Vue {
  @Ref() readonly anotherComponent!: HTMLElement
  @Model('change', { type: Boolean }) readonly checked!: boolean
  /**
   * My foo
   */
  @Prop({ type: Boolean, default: false }) foo: any

  @Provide() foa = 'foo'
  @Provide('bar') baz = 'bar'

  @Inject() readonly foai!: string
  @Inject('bar') readonly bari!: string
  @Inject({ from: 'optional', default: 'default' }) readonly optional!: string
  @Inject(symbol) readonly bazi!: string

  /**
   * My msg
   */
  msg = 'Vetur means "Winter" in icelandic.' //foo

  /**
   * My count
   */
  get count () {
    return this.$store.state.count
  }

  /**
github yoyo930021 / vc2c / tests / fixture / Input.vue View on Github external
})
export default class BasicPropertyClass extends Vue {
  @Ref() readonly anotherComponent!: HTMLElement
  @Model('change', { type: Boolean }) readonly checked!: boolean
  /**
   * My foo
   */
  @Prop({ type: Boolean, default: false }) foo: any

  @Provide() foa = 'foo'
  @Provide('bar') baz = 'bar'

  @Inject() readonly foai!: string
  @Inject('bar') readonly bari!: string
  @Inject({ from: 'optional', default: 'default' }) readonly optional!: string
  @Inject(symbol) readonly bazi!: string

  /**
   * My msg
   */
  msg = 'Vetur means "Winter" in icelandic.' //foo

  /**
   * My count
   */
  get count () {
    return this.$store.state.count
  }

  /**
   * My greeting
   */
github FantasticFiasco / searchlight / src / renderer / components / device.vue View on Github external
AxisWebService,
    InvalidDeviceIconEvent,
} from '../services';
import { Heartbeats } from './heartbeats';

@Component({
    name: 'device',
    components: {
        Heartbeats,
    }
})
export default class Device extends Vue {
    @Prop({ type: Model })
    private readonly device: Model;

    @Inject(ANALYTICS_SERVICE)
    private readonly analyticsService: AnalyticsService;

    @Inject(AXIS_WEB_SERVICE)
    private readonly axisWebService: AxisWebService;

    public isIconAvailableOnAxisWeb = true;

    public get iconUrl(): string {
        this.isIconAvailableOnAxisWeb = true;

        return this.axisWebService.iconUrl(this.device.modelNumber);;
    }

    public get timestamps(): Date[] {
        return this.$store.state.heartbeats[this.device.macAddress];
    }
github michitaro / vue-menu / src / menubaritem / script.ts View on Github external
export const MENUBARITEM_KEY = '@hscmap/vue-menu/menubaritem'


@Component({
    components: { XMenu: Menu },
    provide() { return { [MENUBARITEM_KEY]: this } }
})
export class MenubaritemType extends Vue {
    @Prop({ type: String, required: true })
    private label!: string

    @Inject(MENUBAR_KEY)
    private menubar!: MenubarType

    @Inject(MENU_STYLE_KEY)
    private menuStyle!: MenuStyle

    private hover = false
    private isOpen = false

    mounted() {
        this.menu().$on(MenuCloseEvent.type, (e: MenuCloseEvent) => {
            this.isOpen = false
            e.fromChild && this.menubar.deactivate()
        })
        this.menubar.$on(MenubaritemActivateEvent.type, (e: MenubaritemActivateEvent) => {
            if (this != e.menubaritem) {
                const menu = this.menu()
                menu && menu.close(false)
            }
        })