How to use the vue-property-decorator.Provide 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 MoePlayer / vue-aplayer / packages / @moefe / vue-aplayer / components / Player.tsx View on Github external
@Provide()
  private handleToggleOrderMode() {
    this.$emit('toggleOrderMode');
  }

  @Provide()
  private handleToggleLoopMode() {
    this.$emit('toggleLoopMode');
  }

  @Provide()
  private handleTogglePlaylist() {
    this.$emit('togglePlaylist');
  }

  @Provide()
  private handleToggleLyric() {
    this.$emit('toggleLyric');
  }

  @Provide()
  private handleChangeVolume(volume: number) {
    this.$emit('changeVolume', volume);
  }

  @Provide()
  private handleChangeProgress(e: MouseEvent | TouchEvent, percent: number) {
    this.$emit('changeProgress', e, percent);
  }

  private handleMiniSwitcher() {
    this.$emit('miniSwitcher');
github MoePlayer / vue-aplayer / packages / @moefe / vue-aplayer / components / Player.tsx View on Github external
private get playIcon(): string {
    return this.aplayer.media.paused ? 'play' : 'pause';
  }

  @Provide()
  private handleTogglePlay() {
    this.$emit('togglePlay');
  }

  @Provide()
  private handleSkipBack() {
    this.$emit('skipBack');
  }

  @Provide()
  private handleSkipForward() {
    this.$emit('skipForward');
  }

  @Provide()
  private handleToggleOrderMode() {
    this.$emit('toggleOrderMode');
  }

  @Provide()
  private handleToggleLoopMode() {
    this.$emit('toggleLoopMode');
  }

  @Provide()
  private handleTogglePlaylist() {
github MoePlayer / vue-aplayer / packages / @moefe / vue-aplayer / components / Player.tsx View on Github external
@Provide()
  private handleSkipForward() {
    this.$emit('skipForward');
  }

  @Provide()
  private handleToggleOrderMode() {
    this.$emit('toggleOrderMode');
  }

  @Provide()
  private handleToggleLoopMode() {
    this.$emit('toggleLoopMode');
  }

  @Provide()
  private handleTogglePlaylist() {
    this.$emit('togglePlaylist');
  }

  @Provide()
  private handleToggleLyric() {
    this.$emit('toggleLyric');
  }

  @Provide()
  private handleChangeVolume(volume: number) {
    this.$emit('changeVolume', volume);
  }

  @Provide()
  private handleChangeProgress(e: MouseEvent | TouchEvent, percent: number) {
github sascha245 / vue-threejs-composer / src / components / AssetBundle.ts View on Github external
@Component
export class AssetBundle extends Mixins(AppComponent) {
  @Prop({ type: String, required: true })
  public name!: string;

  @Prop({ type: Boolean, default: false })
  public preload!: boolean;

  @Prop({ type: Number, default: 0 })
  public timeout!: number;

  @Prop({ type: [String, Array], default: () => [] })
  public dependencies!: string | string[];

  @Provide("bundle")
  private provideBundle = Provider.defaultValue();

  private getBundle() {
    return this.m_bundle;
  }

  private m_active = false;
  private m_bundle!: BundleHandle;

  public mounted() {
    this.m_bundle = this.app.assets.bundles.create(this.name);
    this.m_bundle.onLoad.on(this.onLoad);
    this.m_bundle.onUnload.on(this.onUnload);
    this.m_bundle.preload = this.preload;
    this.m_bundle.unloadTimeout = this.timeout;
github sascha245 / vue-threejs-composer / src / v2 / components / Camera.ts View on Github external
import { Component, Mixins, Prop, Provide, Vue } from "vue-property-decorator";

import { CameraFactory, CameraHandle } from "../core";
import { ObjectComponent } from "../mixins";

@Component
export class Camera extends Mixins(ObjectComponent) {
  @Prop({ required: true, type: String })
  private name!: string;

  @Prop({ required: true, type: Function })
  public factory!: CameraFactory;

  @Provide("object")
  public provideObject = this.getObject;

  private m_active = false;
  private m_camera!: CameraHandle;

  public getObject() {
    return this.m_camera.get();
  }

  public onActivate = async () => {
    this.m_active = true;
  };
  public onDeactivate = async () => {
    this.m_active = false;
    await Vue.nextTick();
  };
github casual-simulation / aux / src / aux-server / aux-web / aux-player / PlayerApp / PlayerApp.ts View on Github external
get versionTooltip() {
        return appManager.version.gitCommit;
    }

    get isAdmin() {
        return this.loginInfo && this.loginInfo.roles.indexOf(ADMIN_ROLE) >= 0;
    }

    /**
     * Adds a new sidebar item to the sidebar.
     * @param id
     * @param text
     * @param click
     */
    @Provide()
    addSidebarItem(
        id: string,
        text: string,
        click: () => void,
        icon: string = null,
        group: string = null
    ) {
        const index = findIndex(this.extraItems, i => i.id === id);
        if (index >= 0) {
            this.extraItems[index] = {
                id: id,
                group: group,
                text: text,
                icon: icon,
                click: click,
            };
github wuhao000 / antd-mobile-vue / src / packages / vmc-calendar / calendar-base.tsx View on Github external
public static DefaultHeader = Header;
  public static DefaultShortcut = ShortcutPanel;

  public state = {
    showTimePicker: false,
    timePickerTitle: '',
    startDate: undefined,
    endDate: undefined,
    disConfirmBtn: true,
    clientHeight: 0,
    contentStyle: {},
    visible: this.visible
  };

  @Provide('currentValue')
  public currentValue: Date[] = [];

  @Watch('state', {deep: true})
  public stateChanged(value: any) {
    this.currentValue[0] = value.startDate;
    this.currentValue[1] = value.endDate;
  }

  public created() {
    if (this.defaultValue) {
      const defaultValue = this.defaultValue;
      this.state = {
        ...this.state,
        ...this.selectDate(defaultValue[1], true, {startDate: defaultValue[0]})
      };
    }
github sascha245 / vue-threejs-composer / src / v2 / components / AssetBundle.ts View on Github external
import { BundleHandle } from "../core";
import { AppComponent } from "../mixins";
import { stringToArray } from "../utils/toArray";

@Component
export class AssetBundle extends Mixins(AppComponent) {
  @Prop({ type: String, required: true })
  public name!: string;

  @Prop({ type: Boolean, default: false })
  public preload!: boolean;

  @Prop({ type: [String, Array], default: () => [] })
  public dependencies!: string | string[];

  @Provide("bundle")
  private provideBundle = this.getBundle;

  private getBundle() {
    return this.m_bundle;
  }

  private m_active = false;
  private m_bundle!: BundleHandle;

  public mounted() {
    this.m_bundle = this.app().assets.bundles.create(this.name);
    this.m_bundle.onLoad.on(this.onLoad);
    this.m_bundle.onUnload.on(this.onUnload);

    this.m_bundle.preload = this.preload;
  }
github GerkinDev / vuejs-datatable / src / components / mixins / table-type-consumer-factory.ts View on Github external
export const tableTypeConsumerFactory = ( tableType: TableType ): typeof Vue & ( new() => ITableTypeConsumer ) => {
	/**
	 * This mixin provide a [[TableType]] to inner components, which allow them to access [[Settings]] (through [[TableType.setting]])
	 */
	@Component
	class TableTypeConsumer extends Vue implements ITableTypeConsumer {
		/**
		 * Provide the current [[TableType]] to inner components.
		 *
		 * @vue Provide `table-type`
		 */
		@Provide( 'table-type' )
		public get tableType() {
			return tableType;
		}
	}
	return TableTypeConsumer;
};