How to use the vue-property-decorator.Vue.directive 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 dawg / vusic / src / dawg / extensions / core / palette / palette.ts View on Github external
mouseover: () => {
          this.hover = true;
        },
        mouseleave: () => {
          this.hover = false;
        },
      },
      style: this.style,
      class: 'text-default',
    }, [text, spacer, shortcut]);
  }
}

// NOT SUre if we should render this globally
// ....... oh well
Vue.directive('focus', {
  inserted(el) {
    el.focus();
  },
});

@Component
export class TextField extends Vue {
  @Prop({ type: String, required: true }) public value!: string;
  @Prop({ type: Boolean, default: false }) public autofocus!: boolean;
  @Prop({ type: String, default: '' }) public placeholder!: string;

  public render(h: CreateElement) {
    const directives = this.autofocus ? [{ name: 'focus' }] : [];

    return h('input', {
      props: {
github fe6 / water / src / components / select / src / Select.vue View on Github external
import { isArray } from '@/helper/type';
  import {
    OptionsEntity,
    FieldNamesEntity,
    ReturnParamsEntity,
    fieldNamesDefault,
  } from './entity';
  import RenderOption from './renderoption';
  import { setPostion } from '@/helper/poper';
  import { handleName, findEnabled, toggleItem } from '@/helper/option';
  import { noop } from '@/helper/noop';
  import poperMixin from '@/helper/popermixin';

  Vue.directive('transfer-dom', TransferDom as any);

  Vue.directive('doc-click', docClick as any);

  @Component({
    components: {
      RenderOption,
    },
  })
  export default class Select extends mixins(poperMixin) {
    name: string = 'WSelect';

    optStatus: boolean = false;

    loadingValue: boolean = false;

    slotsData: any[] = [];

    nameTags: any[] = [];
github fe6 / water / src / components / select / src / Select.vue View on Github external
import docClick from '@/directives/doclick';
  import { hasOwn } from '@/helper/o';
  import { isArray } from '@/helper/type';
  import {
    OptionsEntity,
    FieldNamesEntity,
    ReturnParamsEntity,
    fieldNamesDefault,
  } from './entity';
  import RenderOption from './renderoption';
  import { setPostion } from '@/helper/poper';
  import { handleName, findEnabled, toggleItem } from '@/helper/option';
  import { noop } from '@/helper/noop';
  import poperMixin from '@/helper/popermixin';

  Vue.directive('transfer-dom', TransferDom as any);

  Vue.directive('doc-click', docClick as any);

  @Component({
    components: {
      RenderOption,
    },
  })
  export default class Select extends mixins(poperMixin) {
    name: string = 'WSelect';

    optStatus: boolean = false;

    loadingValue: boolean = false;

    slotsData: any[] = [];
github fe6 / water / src / components / datepicker / src / DatePicker.vue View on Github external
} from '@/components/datepicker/src/DatePickerTable.vue';
  import TimePanel, {
    PanelChangeEntity,
  } from '@/components/timepicker/src/TimePanel.vue';
  import WInput from '@/components/input/src/Input.vue';
  import WIcon from '@/components/icon/src/Icon.vue';
  import { pickerSvg, PickerSvgEntity } from '@/helper/pickersvg';
  import { hasOwn } from '@/helper/o';
  import poperMixin from '@/helper/popermixin';
  import { isString, isUndefined } from '@/helper/type';
  import { setPostion } from '@/helper/poper';
  import { noop } from '@/helper/noop';

  Vue.directive('transfer-dom', TransferDom as any);

  Vue.directive('doc-click', docClick as any);

  export interface ChangeEntity extends PickerTableChangeEntity {
    tableType: string;
  }

  export interface TablePanelChangeEntity {
    tableType: String;
    tableOptions:
      | DateEntity[]
      | MonthInMonthsEntity[]
      | AgesInAgesEntity[]
      | YearInYearsEntity[];
    nowRangeYear: string;
    nowRangeAge: string;
    value: string;
    nowYear: number;