Сделана большая часть страниц, без дизайна
This commit is contained in:
parent
2dfe7858a2
commit
6581332174
@ -1,710 +0,0 @@
|
||||
/* Element Chalk Variables */
|
||||
|
||||
/* Transition
|
||||
-------------------------- */
|
||||
$--all-transition: all .3s cubic-bezier(.645,.045,.355,1) !default;
|
||||
$--fade-transition: opacity 300ms cubic-bezier(0.23, 1, 0.32, 1) !default;
|
||||
$--fade-linear-transition: opacity 200ms linear !default;
|
||||
$--md-fade-transition: transform 300ms cubic-bezier(0.23, 1, 0.32, 1) 100ms, opacity 300ms cubic-bezier(0.23, 1, 0.32, 1) 100ms !default;
|
||||
$--border-transition-base: border-color .2s cubic-bezier(.645,.045,.355,1) !default;
|
||||
$--color-transition-base: color .2s cubic-bezier(.645,.045,.355,1) !default;
|
||||
|
||||
/* Colors
|
||||
-------------------------- */
|
||||
$--color-white: #fff !default;
|
||||
$--color-black: #000 !default;
|
||||
|
||||
$--color-primary: #409EFF !default;
|
||||
$--color-primary-light-1: mix($--color-white, $--color-primary, 10%) !default; /* 53a8ff */
|
||||
$--color-primary-light-2: mix($--color-white, $--color-primary, 20%) !default; /* 66b1ff */
|
||||
$--color-primary-light-3: mix($--color-white, $--color-primary, 30%) !default; /* 79bbff */
|
||||
$--color-primary-light-4: mix($--color-white, $--color-primary, 40%) !default; /* 8cc5ff */
|
||||
$--color-primary-light-5: mix($--color-white, $--color-primary, 50%) !default; /* a0cfff */
|
||||
$--color-primary-light-6: mix($--color-white, $--color-primary, 60%) !default; /* b3d8ff */
|
||||
$--color-primary-light-7: mix($--color-white, $--color-primary, 70%) !default; /* c6e2ff */
|
||||
$--color-primary-light-8: mix($--color-white, $--color-primary, 80%) !default; /* d9ecff */
|
||||
$--color-primary-light-9: mix($--color-white, $--color-primary, 90%) !default; /* ecf5ff */
|
||||
|
||||
$--color-success: #67c23a !default;
|
||||
$--color-warning: #eb9e05 !default;
|
||||
$--color-danger: #fa5555 !default;
|
||||
$--color-info: #878d99 !default;
|
||||
|
||||
$--color-success-light: mix($--color-white, $--color-success, 80%) !default;
|
||||
$--color-warning-light: mix($--color-white, $--color-warning, 80%) !default;
|
||||
$--color-danger-light: mix($--color-white, $--color-danger, 80%) !default;
|
||||
$--color-info-light: mix($--color-white, $--color-info, 80%) !default;
|
||||
|
||||
$--color-success-lighter: mix($--color-white, $--color-success, 90%) !default;
|
||||
$--color-warning-lighter: mix($--color-white, $--color-warning, 90%) !default;
|
||||
$--color-danger-lighter: mix($--color-white, $--color-danger, 90%) !default;
|
||||
$--color-info-lighter: mix($--color-white, $--color-info, 90%) !default;
|
||||
|
||||
$--color-text-primary: #2d2f33 !default;
|
||||
$--color-text-regular: #5a5e66 !default;
|
||||
$--color-text-secondary: #878d99 !default;
|
||||
$--color-text-placeholder: #b4bccc !default;
|
||||
|
||||
/* Link
|
||||
-------------------------- */
|
||||
$--link-color: $--color-primary-light-2 !default;
|
||||
$--link-hover-color: $--color-primary !default;
|
||||
|
||||
/* Background
|
||||
-------------------------- */
|
||||
$--background-color-base: #f5f7fa !default;
|
||||
|
||||
/* Border
|
||||
-------------------------- */
|
||||
$--border-width-base: 1px !default;
|
||||
$--border-style-base: solid !default;
|
||||
$--border-color-base: #d8dce5 !default;
|
||||
$--border-color-light: #dfe4ed !default;
|
||||
$--border-color-lighter: #e6ebf5 !default;
|
||||
$--border-color-extra-light: #edf2fc !default;
|
||||
$--border-color-hover: $--color-text-placeholder !default;
|
||||
$--border-base: $--border-width-base $--border-style-base $--border-color-base !default;
|
||||
$--border-radius-base: 4px !default;
|
||||
$--border-radius-small: 2px !default;
|
||||
$--border-radius-circle: 100% !default;
|
||||
|
||||
/* Box-shadow
|
||||
-------------------------- */
|
||||
$--box-shadow-base: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04) !default;
|
||||
$--box-shadow-dark: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .12) !default;
|
||||
$--box-shadow-light: 0 2px 12px 0 rgba(0, 0, 0, 0.1) !default;
|
||||
|
||||
/* Fill
|
||||
-------------------------- */
|
||||
$--fill-base: $--color-white !default;
|
||||
|
||||
/* Font
|
||||
-------------------------- */
|
||||
$--font-path: 'fonts' !default;
|
||||
$--font-size-base: 14px !default;
|
||||
$--font-size-small: 13px !default;
|
||||
$--font-size-large: 18px !default;
|
||||
$--font-color-disabled-base: #bbb !default;
|
||||
$--font-weight-primary: 500 !default;
|
||||
$--font-line-height-primary: 24px !default;
|
||||
|
||||
/* Size
|
||||
-------------------------- */
|
||||
$--size-base: 14px !default;
|
||||
|
||||
/* z-index
|
||||
-------------------------- */
|
||||
$--index-normal: 1 !default;
|
||||
$--index-top: 1000 !default;
|
||||
$--index-popper: 2000 !default;
|
||||
|
||||
/* Disable base
|
||||
-------------------------- */
|
||||
$--disabled-fill-base: $--background-color-base !default;
|
||||
$--disabled-color-base: $--color-text-placeholder !default;
|
||||
$--disabled-border-base: $--border-color-light !default;
|
||||
|
||||
/* Icon
|
||||
-------------------------- */
|
||||
$--icon-color: #666 !default;
|
||||
$--icon-color-base: $--color-info !default;
|
||||
|
||||
/* Checkbox
|
||||
-------------------------- */
|
||||
$--checkbox-font-size: 14px !default;
|
||||
$--checkbox-font-weight: $--font-weight-primary !default;
|
||||
$--checkbox-color: $--color-text-regular !default;
|
||||
$--checkbox-input-height: 14px !default;
|
||||
$--checkbox-input-width: 14px !default;
|
||||
$--checkbox-input-border-radius: $--border-radius-small !default;
|
||||
$--checkbox-input-fill: $--color-white !default;
|
||||
$--checkbox-input-border: $--border-base !default;
|
||||
$--checkbox-input-border-color: $--border-color-base !default;
|
||||
$--checkbox-icon-color: $--color-white !default;
|
||||
|
||||
$--checkbox-disabled-input-border-color: $--border-color-base !default;
|
||||
$--checkbox-disabled-input-fill: #edf2fc !default;
|
||||
$--checkbox-disabled-icon-color: $--color-text-placeholder !default;
|
||||
|
||||
$--checkbox-disabled-checked-input-fill: $--border-color-extra-light !default;
|
||||
$--checkbox-disabled-checked-input-border-color: $--border-color-base !default;
|
||||
$--checkbox-disabled-checked-icon-color: $--color-text-placeholder !default;
|
||||
|
||||
$--checkbox-checked-text-color: $--color-primary !default;
|
||||
$--checkbox-checked-input-border-color: $--color-primary !default;
|
||||
$--checkbox-checked-input-fill: $--color-primary !default;
|
||||
$--checkbox-checked-icon-color: $--fill-base !default;
|
||||
|
||||
$--checkbox-input-border-color-hover: $--color-primary !default;
|
||||
|
||||
$--checkbox-bordered-height: 40px !default;
|
||||
$--checkbox-bordered-padding: 9px 20px 9px 10px !default;
|
||||
$--checkbox-bordered-medium-padding: 7px 20px 7px 10px !default;
|
||||
$--checkbox-bordered-small-padding: 5px 15px 5px 10px !default;
|
||||
$--checkbox-bordered-mini-padding: 3px 15px 3px 10px !default;
|
||||
$--checkbox-bordered-medium-input-height: 14px !default;
|
||||
$--checkbox-bordered-medium-input-width: 14px !default;
|
||||
$--checkbox-bordered-medium-height: 36px !default;
|
||||
$--checkbox-bordered-small-input-height: 12px !default;
|
||||
$--checkbox-bordered-small-input-width: 12px !default;
|
||||
$--checkbox-bordered-small-height: 32px !default;
|
||||
$--checkbox-bordered-mini-input-height: 12px !default;
|
||||
$--checkbox-bordered-mini-input-width: 12px !default;
|
||||
$--checkbox-bordered-mini-height: 28px !default;
|
||||
|
||||
$--checkbox-button-font-size: $--font-size-base !default;
|
||||
$--checkbox-button-checked-fill: $--color-primary !default;
|
||||
$--checkbox-button-checked-color: $--color-white !default;
|
||||
$--checkbox-button-checked-border-color: $--color-primary !default;
|
||||
|
||||
|
||||
|
||||
/* Radio
|
||||
-------------------------- */
|
||||
$--radio-font-size: 14px !default;
|
||||
$--radio-font-weight: $--font-weight-primary !default;
|
||||
$--radio-color: $--color-text-regular !default;
|
||||
$--radio-input-height: 14px !default;
|
||||
$--radio-input-width: 14px !default;
|
||||
$--radio-input-border-radius: $--border-radius-circle !default;
|
||||
$--radio-input-fill: $--color-white !default;
|
||||
$--radio-input-border: $--border-base !default;
|
||||
$--radio-input-border-color: $--border-color-base !default;
|
||||
$--radio-icon-color: $--color-white !default;
|
||||
|
||||
$--radio-disabled-input-border-color: $--disabled-border-base !default;
|
||||
$--radio-disabled-input-fill: $--disabled-fill-base !default;
|
||||
$--radio-disabled-icon-color: $--disabled-fill-base !default;
|
||||
|
||||
$--radio-disabled-checked-input-border-color: $--disabled-border-base !default;
|
||||
$--radio-disabled-checked-input-fill: $--disabled-fill-base !default;
|
||||
$--radio-disabled-checked-icon-color: $--color-text-placeholder !default;
|
||||
|
||||
$--radio-checked-text-color: $--color-primary !default;
|
||||
$--radio-checked-input-border-color: $--color-primary !default;
|
||||
$--radio-checked-input-fill: $--color-white !default;
|
||||
$--radio-checked-icon-color: $--color-primary !default;
|
||||
|
||||
$--radio-input-border-color-hover: $--color-primary !default;
|
||||
|
||||
$--radio-bordered-height: 40px !default;
|
||||
$--radio-bordered-padding: 12px 20px 0 10px !default;
|
||||
$--radio-bordered-medium-padding: 10px 20px 0 10px !default;
|
||||
$--radio-bordered-small-padding: 8px 15px 0 10px !default;
|
||||
$--radio-bordered-mini-padding: 6px 15px 0 10px !default;
|
||||
$--radio-bordered-medium-input-height: 14px !default;
|
||||
$--radio-bordered-medium-input-width: 14px !default;
|
||||
$--radio-bordered-medium-height: 36px !default;
|
||||
$--radio-bordered-small-input-height: 12px !default;
|
||||
$--radio-bordered-small-input-width: 12px !default;
|
||||
$--radio-bordered-small-height: 32px !default;
|
||||
$--radio-bordered-mini-input-height: 12px !default;
|
||||
$--radio-bordered-mini-input-width: 12px !default;
|
||||
$--radio-bordered-mini-height: 28px !default;
|
||||
|
||||
$--radio-button-font-size: $--font-size-base !default;
|
||||
$--radio-button-checked-fill: $--color-primary !default;
|
||||
$--radio-button-checked-color: $--color-white !default;
|
||||
$--radio-button-checked-border-color: $--color-primary !default;
|
||||
$--radio-button-disabled-checked-fill: $--border-color-extra-light !default;
|
||||
|
||||
/* Select
|
||||
-------------------------- */
|
||||
$--select-border-color-hover: $--border-color-hover !default;
|
||||
$--select-disabled-border: $--disabled-border-base !default;
|
||||
$--select-font-size: $--font-size-base !default;
|
||||
$--select-close-hover-color: $--color-text-secondary !default;
|
||||
|
||||
$--select-input-color: $--color-text-placeholder !default;
|
||||
$--select-multiple-input-color: #666 !default;
|
||||
$--select-input-focus-background: $--color-primary !default;
|
||||
$--select-input-font-size: 14px !default;
|
||||
|
||||
$--select-option-color: $--color-text-regular !default;
|
||||
$--select-option-disabled-color: $--color-text-placeholder !default;
|
||||
$--select-option-disabled-background: $--color-white !default;
|
||||
$--select-option-height: 34px !default;
|
||||
$--select-option-hover-background: $--background-color-base !default;
|
||||
$--select-option-selected: $--color-primary !default;
|
||||
$--select-option-selected-hover: $--background-color-base !default;
|
||||
|
||||
$--select-group-color: $--color-info !default;
|
||||
$--select-group-height: 30px !default;
|
||||
$--select-group-font-size: 12px !default;
|
||||
|
||||
$--select-dropdown-background: $--color-white !default;
|
||||
$--select-dropdown-shadow: $--box-shadow-light !default;
|
||||
$--select-dropdown-empty-color: #999 !default;
|
||||
$--select-dropdown-max-height: 274px !default;
|
||||
$--select-dropdown-padding: 6px 0 !default;
|
||||
$--select-dropdown-empty-padding: 10px 0 !default;
|
||||
$--select-dropdown-border: solid 1px $--border-color-light !default;
|
||||
|
||||
/* Alert
|
||||
-------------------------- */
|
||||
$--alert-padding: 8px 16px !default;
|
||||
$--alert-border-radius: $--border-radius-base !default;
|
||||
$--alert-title-font-size: 13px !default;
|
||||
$--alert-description-font-size: 12px !default;
|
||||
$--alert-close-font-size: 12px !default;
|
||||
$--alert-close-customed-font-size: 13px !default;
|
||||
|
||||
$--alert-success-color: $--color-success-lighter !default;
|
||||
$--alert-info-color: $--color-info-lighter !default;
|
||||
$--alert-warning-color: $--color-warning-lighter !default;
|
||||
$--alert-danger-color: $--color-danger-lighter !default;
|
||||
|
||||
$--alert-icon-size: 16px !default;
|
||||
$--alert-icon-large-size: 28px !default;
|
||||
|
||||
/* Message Box
|
||||
-------------------------- */
|
||||
$--msgbox-width: 420px !default;
|
||||
$--msgbox-border-radius: 4px !default;
|
||||
$--msgbox-font-size: $--font-size-large !default;
|
||||
$--msgbox-content-font-size: $--font-size-base !default;
|
||||
$--msgbox-content-color: $--color-text-regular !default;
|
||||
$--msgbox-error-font-size: 12px !default;
|
||||
$--msgbox-padding-primary: 15px !default;
|
||||
|
||||
$--msgbox-success-color: $--color-success !default;
|
||||
$--msgbox-info-color: $--color-info !default;
|
||||
$--msgbox-warning-color: $--color-warning !default;
|
||||
$--msgbox-danger-color: $--color-danger !default;
|
||||
|
||||
/* Message
|
||||
-------------------------- */
|
||||
$--message-shadow: $--box-shadow-base !default;
|
||||
$--message-min-width: 380px !default;
|
||||
$--message-background-color: #edf2fc !default;
|
||||
$--message-padding: 15px 15px 15px 20px !default;
|
||||
$--message-content-color: $--color-text-regular !default;
|
||||
$--message-close-color: $--color-text-placeholder !default;
|
||||
$--message-close-size: 16px !default;
|
||||
$--message-close-hover-color: $--color-text-secondary !default;
|
||||
|
||||
$--message-success-color: $--color-success !default;
|
||||
$--message-info-color: $--color-info !default;
|
||||
$--message-warning-color: $--color-warning !default;
|
||||
$--message-danger-color: $--color-danger !default;
|
||||
|
||||
/* Notification
|
||||
-------------------------- */
|
||||
$--notification-width: 330px !default;
|
||||
$--notification-padding: 14px 26px 14px 13px !default;
|
||||
$--notification-raduis: 8px !default;
|
||||
$--notification-shadow: $--box-shadow-light !default;
|
||||
$--notification-border-color: $--border-color-lighter !default;
|
||||
$--notification-icon-size: 24px !default;
|
||||
$--notification-close-font-size: $--message-close-size !default;
|
||||
$--notification-group-margin: 13px !default;
|
||||
$--notification-font-size: $--font-size-base !default;
|
||||
$--notification-color: $--color-text-regular !default;
|
||||
$--notification-title-font-size: 16px !default;
|
||||
$--notification-title-color: $--color-text-primary !default;
|
||||
|
||||
$--notification-close-color: $--color-text-secondary !default;
|
||||
$--notification-close-hover-color: $--color-text-regular !default;
|
||||
|
||||
$--notification-success-color: $--color-success !default;
|
||||
$--notification-info-color: $--color-info !default;
|
||||
$--notification-warning-color: $--color-warning !default;
|
||||
$--notification-danger-color: $--color-danger !default;
|
||||
|
||||
/* Input
|
||||
-------------------------- */
|
||||
$--input-font-size: $--font-size-base !default;
|
||||
$--input-color: $--color-text-regular !default;
|
||||
$--input-width: 140px !default;
|
||||
$--input-height: 40px !default;
|
||||
$--input-border: $--border-base !default;
|
||||
$--input-border-color: $--border-color-base !default;
|
||||
$--input-border-radius: $--border-radius-base !default;
|
||||
$--input-border-color-hover: $--border-color-hover !default;
|
||||
$--input-fill: $--color-white !default;
|
||||
$--input-fill-disabled: $--disabled-fill-base !default;
|
||||
$--input-color-disabled: $--font-color-disabled-base !default;
|
||||
$--input-icon-color: $--color-text-placeholder !default;
|
||||
$--input-placeholder-color: $--color-text-placeholder !default;
|
||||
$--input-max-width: 314px !default;
|
||||
|
||||
$--input-hover-border: $--border-color-hover !default;
|
||||
|
||||
$--input-focus-border: $--color-primary !default;
|
||||
$--input-focus-fill: $--color-white !default;
|
||||
|
||||
$--input-disabled-fill: $--disabled-fill-base !default;
|
||||
$--input-disabled-border: $--disabled-border-base !default;
|
||||
$--input-disabled-color: $--disabled-color-base !default;
|
||||
$--input-disabled-placeholder-color: $--color-text-placeholder !default;
|
||||
|
||||
$--input-medium-font-size: 14px !default;
|
||||
$--input-medium-height: 36px !default;
|
||||
|
||||
$--input-small-font-size: 13px !default;
|
||||
$--input-small-height: 32px !default;
|
||||
|
||||
$--input-mini-font-size: 12px !default;
|
||||
$--input-mini-height: 28px !default;
|
||||
|
||||
/* Cascader
|
||||
-------------------------- */
|
||||
$--cascader-menu-fill: $--fill-base !default;
|
||||
$--cascader-menu-font-size: $--font-size-base !default;
|
||||
$--cascader-menu-radius: $--border-radius-base !default;
|
||||
$--cascader-menu-border: $--border-base !default;
|
||||
$--cascader-menu-border-color: $--border-color-base !default;
|
||||
$--cascader-menu-border-width: $--border-width-base !default;
|
||||
$--cascader-menu-color: $--color-text-regular !default;
|
||||
$--cascader-menu-option-color-active: $--color-text-secondary !default;
|
||||
$--cascader-menu-option-fill-active: rgba($--color-text-secondary, 0.12) !default;
|
||||
$--cascader-menu-option-color-hover: $--color-text-regular !default;
|
||||
$--cascader-menu-option-fill-hover: rgba($--color-text-primary, 0.06) !default;
|
||||
$--cascader-menu-option-color-disabled: #999 !default;
|
||||
$--cascader-menu-option-fill-disabled: rgba($--color-black, 0.06) !default;
|
||||
$--cascader-menu-option-empty-color: #666 !default;
|
||||
$--cascader-menu-group-color: #999 !default;
|
||||
$--cascader-menu-shadow: 0 1px 2px rgba($--color-black, 0.14), 0 0 3px rgba($--color-black, 0.14) !default;
|
||||
$--cascader-menu-option-pinyin-color: #999 !default;
|
||||
$--cascader-menu-submenu-shadow: 1px 1px 2px rgba($--color-black, 0.14), 1px 0 2px rgba($--color-black, 0.14) !default;
|
||||
|
||||
/* Group
|
||||
-------------------------- */
|
||||
$--group-option-flex: 0 0 (1/5) * 100% !default;
|
||||
$--group-option-offset-bottom: 12px !default;
|
||||
$--group-option-fill-hover: rgba($--color-black, 0.06) !default;
|
||||
$--group-title-color: $--color-black !default;
|
||||
$--group-title-font-size: $--font-size-base !default;
|
||||
$--group-title-width: 66px !default;
|
||||
|
||||
/* Tab
|
||||
-------------------------- */
|
||||
$--tab-font-size: $--font-size-base !default;
|
||||
$--tab-border-line: 1px solid #e4e4e4 !default;
|
||||
$--tab-header-color-active: $--color-text-secondary !default;
|
||||
$--tab-header-color-hover: $--color-text-regular !default;
|
||||
$--tab-header-color: $--color-text-regular !default;
|
||||
$--tab-header-fill-active: rgba($--color-black, 0.06) !default;
|
||||
$--tab-header-fill-hover: rgba($--color-black, 0.06) !default;
|
||||
$--tab-vertical-header-width: 90px !default;
|
||||
$--tab-vertical-header-count-color: $--color-white !default;
|
||||
$--tab-vertical-header-count-fill: $--color-text-secondary !default;
|
||||
|
||||
/* Button
|
||||
-------------------------- */
|
||||
$--button-font-size: 14px !default;
|
||||
$--button-font-weight: $--font-weight-primary !default;
|
||||
$--button-border-radius: $--border-radius-base !default;
|
||||
$--button-padding-vertical: 12px !default;
|
||||
$--button-padding-horizontal: 20px !default;
|
||||
|
||||
$--button-medium-font-size: 14px !default;
|
||||
$--button-medium-border-radius: $--border-radius-base !default;
|
||||
$--button-medium-padding-vertical: 10px !default;
|
||||
$--button-medium-padding-horizontal: 20px !default;
|
||||
|
||||
$--button-small-font-size: 12px !default;
|
||||
$--button-small-border-radius: #{$--border-radius-base - 1} !default;
|
||||
$--button-small-padding-vertical: 9px !default;
|
||||
$--button-small-padding-horizontal: 15px !default;
|
||||
|
||||
$--button-mini-font-size: 12px !default;
|
||||
$--button-mini-border-radius: #{$--border-radius-base - 1} !default;
|
||||
$--button-mini-padding-vertical: 7px !default;
|
||||
$--button-mini-padding-horizontal: 15px !default;
|
||||
|
||||
$--button-default-color: $--color-text-regular !default;
|
||||
$--button-default-fill: $--color-white !default;
|
||||
$--button-default-border: $--border-color-base !default;
|
||||
|
||||
$--button-disabled-color: $--color-text-placeholder !default;
|
||||
$--button-disabled-fill: $--color-white !default;
|
||||
$--button-disabled-border: $--border-color-lighter !default;
|
||||
|
||||
$--button-primary-border: $--color-primary !default;
|
||||
$--button-primary-color: $--color-white !default;
|
||||
$--button-primary-fill: $--color-primary !default;
|
||||
|
||||
$--button-success-border: $--color-success !default;
|
||||
$--button-success-color: $--color-white !default;
|
||||
$--button-success-fill: $--color-success !default;
|
||||
|
||||
$--button-warning-border: $--color-warning !default;
|
||||
$--button-warning-color: $--color-white !default;
|
||||
$--button-warning-fill: $--color-warning !default;
|
||||
|
||||
$--button-danger-border: $--color-danger !default;
|
||||
$--button-danger-color: $--color-white !default;
|
||||
$--button-danger-fill: $--color-danger !default;
|
||||
|
||||
$--button-info-border: $--color-info !default;
|
||||
$--button-info-color: $--color-white !default;
|
||||
$--button-info-fill: $--color-info !default;
|
||||
|
||||
$--button-hover-tint-percent: 20% !default;
|
||||
$--button-active-shade-percent: 10% !default;
|
||||
|
||||
|
||||
/* cascader
|
||||
-------------------------- */
|
||||
$--cascader-height: 200px !default;
|
||||
|
||||
/* Switch
|
||||
-------------------------- */
|
||||
$--switch-on-color: $--color-primary !default;
|
||||
$--switch-off-color: $--border-color-base !default;
|
||||
$--switch-disabled-color: $--border-color-lighter !default;
|
||||
$--switch-disabled-text-color: $--color-text-placeholder !default;
|
||||
|
||||
$--switch-font-size: $--font-size-base !default;
|
||||
$--switch-core-border-radius: 10px !default;
|
||||
$--switch-width: 40px !default;
|
||||
$--switch-height: 20px !default;
|
||||
$--switch-button-size: 16px !default;
|
||||
|
||||
/* Dialog
|
||||
-------------------------- */
|
||||
$--dialog-background-color: $--color-primary-light-4 !default;
|
||||
$--dialog-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !default;
|
||||
$--dialog-close-hover-color: $--color-primary !default;
|
||||
$--dialog-title-font-size: $--font-size-large !default;
|
||||
$--dialog-font-size: 14px !default;
|
||||
$--dialog-line-height: $--font-line-height-primary !default;
|
||||
$--dialog-padding-primary: 15px !default;
|
||||
|
||||
/* Table
|
||||
-------------------------- */
|
||||
$--table-border: 1px solid $--border-color-lighter !default;
|
||||
$--table-text-color: $--color-text-regular !default;
|
||||
$--table-header-color: $--color-text-secondary !default;
|
||||
$--table-row-hover-background: $--background-color-base !default;
|
||||
$--table-current-row-background: $--color-primary-light-9 !default;
|
||||
$--table-header-background: $--color-text-secondary !default;
|
||||
$--table-footer-background: $--color-text-placeholder !default;
|
||||
$--table-fixed-box-shadow: 0 0 10px rgba(0, 0, 0, .12) !default;
|
||||
|
||||
/* Pagination
|
||||
-------------------------- */
|
||||
$--pagination-font-size: 13px !default;
|
||||
$--pagination-fill: $--color-white !default;
|
||||
$--pagination-color: $--color-text-primary !default;
|
||||
$--pagination-border-radius: 3px !default;
|
||||
$--pagination-button-color: $--color-text-primary !default;
|
||||
$--pagination-button-width: 35.5px !default;
|
||||
$--pagination-button-height: 28px !default;
|
||||
$--pagination-button-disabled-color: $--color-text-placeholder !default;
|
||||
$--pagination-button-disabled-fill: $--color-white !default;
|
||||
$--pagination-hover-fill: $--color-primary !default;
|
||||
$--pagination-hover-color: $--color-white !default;
|
||||
|
||||
/* Popover
|
||||
-------------------------- */
|
||||
$--popover-fill: $--color-white !default;
|
||||
$--popover-font-size: $--font-size-base !default;
|
||||
$--popover-border-color: $--border-color-lighter !default;
|
||||
$--popover-arrow-size: 6px !default;
|
||||
$--popover-padding: 12px !default;
|
||||
$--popover-padding-large: 18px 20px !default;
|
||||
$--popover-title-font-size: 16px !default;
|
||||
$--popover-title-color: $--color-text-primary !default;
|
||||
|
||||
/* Tooltip
|
||||
-------------------------- */
|
||||
$--tooltip-fill: $--color-text-primary !default;
|
||||
$--tooltip-color: $--color-white !default;
|
||||
$--tooltip-font-size: 12px !default;
|
||||
$--tooltip-border-color: $--color-text-primary !default;
|
||||
$--tooltip-arrow-size: 6px !default;
|
||||
$--tooltip-padding: 10px !default;
|
||||
|
||||
/* Tag
|
||||
-------------------------- */
|
||||
$--tag-padding: 0 10px !default;
|
||||
$--tag-fill: rgba($--color-primary, 0.10) !default;
|
||||
$--tag-color: $--color-primary !default;
|
||||
$--tag-border: rgba($--color-primary, 0.20) !default;
|
||||
$--tag-font-size: 12px !default;
|
||||
$--tag-border-radius: 4px !default;
|
||||
|
||||
$--tag-info-fill: rgba($--color-info, 0.10) !default;
|
||||
$--tag-info-border: rgba($--color-info, 0.20) !default;
|
||||
$--tag-info-color: $--color-info !default;
|
||||
|
||||
$--tag-primary-fill: rgba($--color-primary, 0.10) !default;
|
||||
$--tag-primary-border: rgba($--color-primary, 0.20) !default;
|
||||
$--tag-primary-color: $--color-primary !default;
|
||||
|
||||
$--tag-success-fill: rgba($--color-success, 0.10) !default;
|
||||
$--tag-success-border: rgba($--color-success, 0.20) !default;
|
||||
$--tag-success-color: $--color-success !default;
|
||||
|
||||
$--tag-warning-fill: rgba($--color-warning, 0.10) !default;
|
||||
$--tag-warning-border: rgba($--color-warning, 0.20) !default;
|
||||
$--tag-warning-color: $--color-warning !default;
|
||||
|
||||
$--tag-danger-fill: rgba($--color-danger, 0.10) !default;
|
||||
$--tag-danger-border: rgba($--color-danger, 0.20) !default;
|
||||
$--tag-danger-color: $--color-danger !default;
|
||||
|
||||
/* Tree
|
||||
-------------------------- */
|
||||
$--tree-node-hover-color: $--background-color-base !default;
|
||||
$--tree-text-color: $--color-text-regular !default;
|
||||
$--tree-expand-icon-color: $--color-text-placeholder !default;
|
||||
|
||||
/* Dropdown
|
||||
-------------------------- */
|
||||
$--dropdown-menu-box-shadow: $--box-shadow-light !default;
|
||||
$--dropdown-menuItem-hover-fill: $--color-primary-light-9 !default;
|
||||
$--dropdown-menuItem-hover-color: $--link-color !default;
|
||||
|
||||
/* Badge
|
||||
-------------------------- */
|
||||
$--badge-fill: $--color-danger !default;
|
||||
$--badge-radius: 10px !default;
|
||||
$--badge-font-size: 12px !default;
|
||||
$--badge-padding: 6px !default;
|
||||
$--badge-size: 18px !default;
|
||||
|
||||
/* Card
|
||||
--------------------------*/
|
||||
$--card-border-color: $--border-color-lighter !default;
|
||||
$--card-border-radius: 4px !default;
|
||||
$--card-padding: 20px !default;
|
||||
|
||||
/* Slider
|
||||
--------------------------*/
|
||||
$--slider-main-background-color: $--color-primary !default;
|
||||
$--slider-runway-background-color: $--border-color-light !default;
|
||||
$--slider-button-hover-color: mix($--color-primary, black, 97%) !default;
|
||||
$--slider-stop-background-color: $--color-white !default;
|
||||
$--slider-disable-color: $--color-text-placeholder !default;
|
||||
|
||||
$--slider-margin: 16px 0 !default;
|
||||
$--slider-border-radius: 3px !default;
|
||||
$--slider-height: 6px !default;
|
||||
$--slider-button-size: 16px !default;
|
||||
$--slider-button-wrapper-size: 36px !default;
|
||||
$--slider-button-wrapper-offset: -15px !default;
|
||||
|
||||
/* Steps
|
||||
--------------------------*/
|
||||
$--steps-border-color: $--disabled-border-base !default;
|
||||
$--steps-border-radius: 4px !default;
|
||||
$--steps-padding: 20px !default;
|
||||
|
||||
/* Menu
|
||||
--------------------------*/
|
||||
$--menu-item-color: $--color-text-primary !default;
|
||||
$--menu-item-fill: $--color-white !default;
|
||||
$--menu-item-hover-fill: $--color-primary-light-9 !default;
|
||||
|
||||
/* Rate
|
||||
--------------------------*/
|
||||
$--rate-height: 20px !default;
|
||||
$--rate-font-size: $--font-size-base !default;
|
||||
$--rate-icon-size: 18px !default;
|
||||
$--rate-icon-margin: 6px !default;
|
||||
$--rate-icon-color: $--color-text-placeholder !default;
|
||||
|
||||
/* DatePicker
|
||||
--------------------------*/
|
||||
$--datepicker-color: $--color-text-regular !default;
|
||||
$--datepicker-off-color: $--color-text-placeholder !default;
|
||||
$--datepicker-header-color: $--color-text-regular !default;
|
||||
$--datepicker-icon-color: $--color-text-primary !default;
|
||||
$--datepicker-border-color: $--disabled-border-base !default;
|
||||
$--datepicker-inner-border-color: #e4e4e4 !default;
|
||||
$--datepicker-inrange-color: $--border-color-extra-light !default;
|
||||
$--datepicker-inrange-hover-color: $--border-color-extra-light !default;
|
||||
$--datepicker-active-color: $--color-primary !default;
|
||||
$--datepicker-text-hover-color: $--color-primary !default;
|
||||
$--datepicker-cell-hover-color: #fff !default;
|
||||
|
||||
/* Loading
|
||||
--------------------------*/
|
||||
$--loading-spinner-size: 42px !default;
|
||||
$--loading-fullscreen-spinner-size: 50px !default;
|
||||
|
||||
/* Scrollbar
|
||||
--------------------------*/
|
||||
$--scrollbar-background-color: rgba($--color-text-secondary, .3) !default;
|
||||
$--scrollbar-hover-background-color: rgba($--color-text-secondary, .5) !default;
|
||||
|
||||
/* Carousel
|
||||
--------------------------*/
|
||||
$--carousel-arrow-font-size: 12px !default;
|
||||
$--carousel-arrow-size: 36px !default;
|
||||
$--carousel-arrow-background: rgba(31, 45, 61, 0.11) !default;
|
||||
$--carousel-arrow-hover-background: rgba(31, 45, 61, 0.23) !default;
|
||||
$--carousel-indicator-width: 30px !default;
|
||||
$--carousel-indicator-height: 2px !default;
|
||||
$--carousel-indicator-padding-horizontal: 4px !default;
|
||||
$--carousel-indicator-padding-vertical: 12px !default;
|
||||
$--carousel-indicator-out-color: $--border-color-hover !default;
|
||||
|
||||
/* Collapse
|
||||
--------------------------*/
|
||||
$--collapse-border-color: $--border-color-lighter !default;
|
||||
$--collapse-header-height: 48px !default;
|
||||
$--collapse-header-padding: 20px !default;
|
||||
$--collapse-header-fill: $--color-white !default;
|
||||
$--collapse-header-color: $--color-text-primary !default;
|
||||
$--collapse-header-size: 13px !default;
|
||||
$--collapse-content-fill: $--color-white !default;
|
||||
$--collapse-content-size: 13px !default;
|
||||
$--collapse-content-color: $--color-text-primary !default;
|
||||
|
||||
/* Transfer
|
||||
--------------------------*/
|
||||
$--transfer-border-color: $--border-color-lighter !default;
|
||||
$--transfer-border-radius: $--border-radius-base !default;
|
||||
$--transfer-panel-width: 200px !default;
|
||||
$--transfer-panel-header-height: 40px !default;
|
||||
$--transfer-panel-header-background: $--background-color-base !default;
|
||||
$--transfer-panel-footer-height: 40px !default;
|
||||
$--transfer-panel-body-height: 246px !default;
|
||||
$--transfer-item-height: 30px !default;
|
||||
$--transfer-item-hover-background: $--color-text-secondary !default;
|
||||
$--transfer-filter-height: 32px !default;
|
||||
|
||||
/* Header
|
||||
--------------------------*/
|
||||
$--header-padding: 0 20px !default;
|
||||
|
||||
/* Footer
|
||||
--------------------------*/
|
||||
$--footer-padding: 0 20px !default;
|
||||
|
||||
/* Main
|
||||
--------------------------*/
|
||||
$--main-padding: 20px !default;
|
||||
|
||||
/* Break-point
|
||||
--------------------------*/
|
||||
$--sm: 768px !default;
|
||||
$--md: 992px !default;
|
||||
$--lg: 1200px !default;
|
||||
$--xl: 1920px !default;
|
||||
|
||||
$--breakpoints: (
|
||||
'xs' : (max-width: $--sm),
|
||||
'sm' : (min-width: $--sm),
|
||||
'md' : (min-width: $--md),
|
||||
'lg' : (min-width: $--lg),
|
||||
'xl' : (min-width: $--xl)
|
||||
);
|
||||
|
||||
$--breakpoints-spec: (
|
||||
'xs-only' : (max-width: $--sm - 1),
|
||||
'sm-and-up' : (min-width: $--sm),
|
||||
'sm-only': "(min-width: #{$--sm}) and (max-width: #{$--md} - 1)",
|
||||
'sm-and-down': (max-width: $--md - 1),
|
||||
'md-and-up' : (min-width: $--md),
|
||||
'md-only': "(min-width: #{$--md}) and (max-width: #{$--lg } - 1)",
|
||||
'md-and-down': (max-width: $--lg - 1),
|
||||
'lg-and-up' : (min-width: $--lg),
|
||||
'lg-only': "(min-width: #{$--lg}) and (max-width: #{$--xl } - 1)",
|
||||
'lg-and-down': (max-width: $--xl - 1),
|
||||
'xl-only' : (min-width: $--xl),
|
||||
);
|
@ -11,6 +11,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"vue": "^2.5.2",
|
||||
"vue-cookies": "^1.5.13",
|
||||
"vue-router": "^3.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@ -7,17 +7,12 @@ body
|
||||
|
||||
<script>
|
||||
import navbar from "@/components/navbar"
|
||||
import Router from "./router"
|
||||
|
||||
export default {
|
||||
name: 'app',
|
||||
data () {
|
||||
return {
|
||||
user: {
|
||||
name: 'dsh147',
|
||||
points: 0,
|
||||
rank: 0
|
||||
}
|
||||
}
|
||||
return { }
|
||||
},
|
||||
components: {
|
||||
navbar,
|
||||
|
@ -1,19 +0,0 @@
|
||||
<template>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'account',
|
||||
data () {
|
||||
return {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
||||
<style scoped>
|
||||
|
||||
</style>
|
@ -15,7 +15,7 @@ export default {
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
@ -1,19 +1,54 @@
|
||||
<template>
|
||||
|
||||
<template lang="pug">
|
||||
form(@submit.prevent="login")
|
||||
fieldset
|
||||
legend Вход
|
||||
label(for="username") Логин
|
||||
input(v-model="username" required id="username" type="text" placeholder="Логин")
|
||||
label(for="password") Пароль
|
||||
input(v-model="password" required id="pasword" type="password" placeholder="Пароль")
|
||||
button(type="submit") Вход
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import vueCookies from 'vue-cookies'
|
||||
import router from '../router/index'
|
||||
import {HTTP} from '../http-common'
|
||||
|
||||
export default {
|
||||
name: 'index',
|
||||
name: 'login',
|
||||
data () {
|
||||
return {
|
||||
msg: 'index'
|
||||
username: "",
|
||||
password: ""
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
login () {
|
||||
var body = {
|
||||
username: this.username,
|
||||
password: this.password
|
||||
}
|
||||
HTTP.post('auth', body).then(
|
||||
response => {
|
||||
window.$cookies.set('token', response.data.token)
|
||||
window.$cookies.set('username', this.username)
|
||||
console.log("congratulations")
|
||||
router.push("account")
|
||||
}
|
||||
).catch(e => {
|
||||
console.log(e)
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if(window.$cookies.get('token')) {
|
||||
router.push("account")
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
@ -1,34 +1,33 @@
|
||||
<template lang="pug">
|
||||
nav
|
||||
h1 CTFЦТФ {{ auth.username }}
|
||||
h1 CTFЦТФ
|
||||
ul
|
||||
li(v-for="item in mainNavbar")
|
||||
router-link(:to="item.component") {{item.name}}
|
||||
ul(v-if="isLoggedIn")
|
||||
li
|
||||
rouuter-link(to="cabinet") Личный кабинет
|
||||
li(v-on:click="logOut()")
|
||||
ul(v-if="!(isLoggedIn)")
|
||||
router-link(to="account") Личный кабинет
|
||||
li
|
||||
router-link(to="login")
|
||||
a(v-on:click="logOut()") Выход
|
||||
ul(v-if="!isLoggedIn")
|
||||
li
|
||||
router-link(to="register")
|
||||
router-link(to="login") Вход
|
||||
li
|
||||
router-link(to="register") Регистрация
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import router from '../router/index'
|
||||
|
||||
export default {
|
||||
name: 'navbar',
|
||||
props: {
|
||||
auth: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
isLoggedIn: false,
|
||||
mainNavbar: {
|
||||
home: {
|
||||
name: "Главная",
|
||||
component: "index"
|
||||
component: "/"
|
||||
},
|
||||
scoreboard: {
|
||||
name: "Статистика",
|
||||
@ -48,17 +47,41 @@ export default {
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
logOut: function() {
|
||||
console.log("Log out");
|
||||
},
|
||||
not: function() { },
|
||||
isLoggedIn: function() { return true}
|
||||
watch: {
|
||||
'$route' (to, from) {
|
||||
if(window.$cookies.get('token')) {
|
||||
this.isLoggedIn = true
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
logOut () {
|
||||
window.$cookies.remove('token')
|
||||
window.$cookies.remove('username')
|
||||
this.isLoggedIn = false
|
||||
router.push("login")
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if(window.$cookies.get('token')) {
|
||||
this.isLoggedIn = true
|
||||
} else {
|
||||
this.isLoggedIn = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
||||
<style scoped>
|
||||
|
||||
<style scoped>
|
||||
li, ul, h1 {
|
||||
display: inline;
|
||||
}
|
||||
li {
|
||||
padding: 10px;
|
||||
}
|
||||
ul {
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
|
@ -1,19 +1,54 @@
|
||||
<template>
|
||||
|
||||
<template lang="pug">
|
||||
form(@submit.prevent="login")
|
||||
fieldset
|
||||
legend Регистрация
|
||||
label(for="username") Логин
|
||||
input(v-model="username" required id="username" type="text" placeholder="Логин")
|
||||
label(for="password") Пароль
|
||||
input(v-model="password" required id="pasword" type="password" placeholder="Пароль")
|
||||
button(type="submit") Регистрация
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import vueCookies from 'vue-cookies'
|
||||
import router from '../router/index'
|
||||
import {HTTP} from '../http-common'
|
||||
|
||||
export default {
|
||||
name: 'index',
|
||||
name: 'register',
|
||||
data () {
|
||||
return {
|
||||
msg: 'index'
|
||||
username: "dsh147",
|
||||
password: "d1F@g147"
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
login () {
|
||||
var body = {
|
||||
username: this.username,
|
||||
password: this.password
|
||||
}
|
||||
HTTP.post('register', body).then(
|
||||
response => {
|
||||
window.$cookies.set('token', response.data.token)
|
||||
window.$cookies.set('username', this.username)
|
||||
console.log("congratulations")
|
||||
router.push("account")
|
||||
}
|
||||
).catch(e => {
|
||||
console.log(e)
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if(window.$cookies.get('token')) {
|
||||
router.push("account")
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
@ -1,19 +1,34 @@
|
||||
<template>
|
||||
|
||||
<template lang="pug">
|
||||
table
|
||||
tr(v-for="user in this.list")
|
||||
td(v-for="characteristics in user")
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import vueCookies from 'vue-cookies'
|
||||
import router from '../router/index'
|
||||
import {HTTP} from '../http-common'
|
||||
|
||||
export default {
|
||||
name: 'index',
|
||||
name: 'scoreboard',
|
||||
data () {
|
||||
return {
|
||||
msg: 'index'
|
||||
list: {}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
HTTP.get('scoreboard')
|
||||
.then(response => {
|
||||
this.list = response.data.users
|
||||
})
|
||||
.catch(e => {
|
||||
console.log(e)
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
@ -1,19 +1,48 @@
|
||||
<template>
|
||||
|
||||
<template lang="pug">
|
||||
div
|
||||
h1 {{task.name}}
|
||||
p {{task.description}}
|
||||
span {{task.category}}
|
||||
span {{task.cost}}
|
||||
span(v-if="task.solved") Решено
|
||||
ul(v-for="name in task.solved_by")
|
||||
li {{name}}
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import vueCookies from 'vue-cookies'
|
||||
import router from '../router/index'
|
||||
import {HTTP} from '../http-common'
|
||||
|
||||
export default {
|
||||
name: 'index',
|
||||
name: 'task',
|
||||
data () {
|
||||
return {
|
||||
msg: 'index'
|
||||
task: {}
|
||||
}
|
||||
},
|
||||
props: {
|
||||
taskID: {
|
||||
type: Number
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
HTTP.get('task', {
|
||||
params: {
|
||||
id: this.taskID
|
||||
}
|
||||
})
|
||||
.then(response => {
|
||||
this.task = response.data
|
||||
})
|
||||
.catch(e => {
|
||||
console.log(e)
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
@ -1,19 +1,40 @@
|
||||
<template>
|
||||
|
||||
<template lang="pug">
|
||||
ul
|
||||
li(v-for="item in list")
|
||||
h1(v-on:click="open(item.id)") {{ item.name }}
|
||||
h2 {{ item.cost }}
|
||||
span {{ item.category }}
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import vueCookies from 'vue-cookies'
|
||||
import router from '../router/index'
|
||||
import {HTTP} from '../http-common'
|
||||
|
||||
export default {
|
||||
name: 'index',
|
||||
name: 'taskList',
|
||||
data () {
|
||||
return {
|
||||
msg: 'index'
|
||||
list: {}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
HTTP.get('tasks')
|
||||
.then(response => {
|
||||
this.list = response.data.tasks
|
||||
})
|
||||
.catch(e => {
|
||||
console.log(e)
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
open(identificator) {
|
||||
router.push({ name: 'task', params: { taskID: identificator } })
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
@ -1,19 +0,0 @@
|
||||
<template>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'template',
|
||||
data () {
|
||||
return {
|
||||
msg: 'template'
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
||||
<style scoped>
|
||||
|
||||
</style>
|
@ -1,8 +1,8 @@
|
||||
import axios from 'axios';
|
||||
import axios from 'axios'
|
||||
|
||||
export const HTTP = axios.create({
|
||||
baseURL: "http://dmitriyp.ru:2052/api/",
|
||||
headers: {
|
||||
Authorization: "Token" + token
|
||||
Authorization: "Token " + window.$cookies.get('token')
|
||||
}
|
||||
});
|
@ -3,21 +3,20 @@
|
||||
import Vue from 'vue'
|
||||
import App from './App'
|
||||
import router from './router'
|
||||
import VueCookies from 'vue-cookies'
|
||||
import Router from 'vue-router'
|
||||
|
||||
VueCookies.config('1d')
|
||||
|
||||
Vue.config.productionTip = false
|
||||
Vue.use(VueCookies)
|
||||
Vue.use(Router)
|
||||
|
||||
/* eslint-disable no-new */
|
||||
new Vue({
|
||||
el: '#app',
|
||||
data () {
|
||||
return {
|
||||
auth: {
|
||||
username: "",
|
||||
token: "",
|
||||
}
|
||||
}
|
||||
},
|
||||
router,
|
||||
router: router,
|
||||
template: '<App/>',
|
||||
render: (h) => h(App),
|
||||
components: { App }
|
||||
})
|
||||
|
@ -1,15 +1,12 @@
|
||||
import Vue from 'vue'
|
||||
import Router from 'vue-router'
|
||||
import vueCookies from 'vue-cookies'
|
||||
import index from '@/components/index'
|
||||
import login from '@/components/login'
|
||||
import register from '@/components/register'
|
||||
import scoreboard from '@/components/scoreboard'
|
||||
import taskList from '@/components/taskList'
|
||||
import task from '@/components/task'
|
||||
import account from '@/components/account'
|
||||
|
||||
|
||||
Vue.use(Router)
|
||||
|
||||
export default new Router({
|
||||
mode: 'history',
|
||||
@ -17,37 +14,39 @@ export default new Router({
|
||||
{
|
||||
path: '/',
|
||||
name: 'index',
|
||||
component: index
|
||||
component: index,
|
||||
meta: {title: 'Главная'}
|
||||
},
|
||||
{
|
||||
path: '/login',
|
||||
name: 'login',
|
||||
component: login
|
||||
component: login,
|
||||
meta: {title: 'Вход'}
|
||||
},
|
||||
{
|
||||
path: '/register',
|
||||
name: 'register',
|
||||
component: register
|
||||
component: register,
|
||||
meta: {title: 'Регистрация'}
|
||||
},
|
||||
{
|
||||
path: '/scoreboard',
|
||||
name: 'scoreboard',
|
||||
component: scoreboard
|
||||
component: scoreboard,
|
||||
meta: {title: 'Таььлица результатов'}
|
||||
},
|
||||
{
|
||||
path: '/taskList',
|
||||
name: 'taskList',
|
||||
component: taskList
|
||||
component: taskList,
|
||||
meta: {title: 'Список задач'}
|
||||
},
|
||||
{
|
||||
path: '/task',
|
||||
path: '/task/:id',
|
||||
name: 'task',
|
||||
component: task
|
||||
},
|
||||
{
|
||||
path: '/tausk',
|
||||
name: 'account',
|
||||
component: account
|
||||
component: task,
|
||||
props: true,
|
||||
meta: {title: 'Задача'}
|
||||
},
|
||||
]
|
||||
})
|
||||
|
@ -7308,6 +7308,11 @@ void-elements@^2.0.1:
|
||||
resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-2.0.1.tgz#c066afb582bb1cb4128d60ea92392e94d5e9dbec"
|
||||
integrity sha1-wGavtYK7HLQSjWDqkjkulNXp2+w=
|
||||
|
||||
vue-cookies@^1.5.13:
|
||||
version "1.5.13"
|
||||
resolved "https://registry.yarnpkg.com/vue-cookies/-/vue-cookies-1.5.13.tgz#b1ca79a2663bf9a4f36982557011cab5ee2196c0"
|
||||
integrity sha512-8pjpXnvbNWx1Lft0t3MJnW+ylv0Wa2Tb6Ch617u/pQah3+SfXUZZdkh3EL3bSpe/Sw2Wdw3+DhycgQsKANSxXg==
|
||||
|
||||
vue-hot-reload-api@^2.2.0:
|
||||
version "2.3.4"
|
||||
resolved "https://registry.yarnpkg.com/vue-hot-reload-api/-/vue-hot-reload-api-2.3.4.tgz#532955cc1eb208a3d990b3a9f9a70574657e08f2"
|
||||
|
6
node_modules/.yarn-integrity
generated
vendored
6
node_modules/.yarn-integrity
generated
vendored
@ -6,14 +6,16 @@
|
||||
"flags": [],
|
||||
"linkedModules": [],
|
||||
"topLevelPatterns": [
|
||||
"axios@^0.19.0"
|
||||
"axios@^0.19.0",
|
||||
"vue-router@^3.1.3"
|
||||
],
|
||||
"lockfileEntries": {
|
||||
"axios@^0.19.0": "https://registry.yarnpkg.com/axios/-/axios-0.19.0.tgz#8e09bff3d9122e133f7b8101c8fbdd00ed3d2ab8",
|
||||
"debug@=3.1.0": "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261",
|
||||
"follow-redirects@1.5.10": "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.5.10.tgz#7b7a9f9aea2fdff36786a94ff643ed07f4ff5e2a",
|
||||
"is-buffer@^2.0.2": "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.3.tgz#4ecf3fcf749cbd1e472689e109ac66261a25e725",
|
||||
"ms@2.0.0": "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
|
||||
"ms@2.0.0": "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8",
|
||||
"vue-router@^3.1.3": "https://registry.yarnpkg.com/vue-router/-/vue-router-3.1.3.tgz#e6b14fabc0c0ee9fda0e2cbbda74b350e28e412b"
|
||||
},
|
||||
"files": [],
|
||||
"artifacts": {}
|
||||
|
140
node_modules/vue-router/CHANGELOG.md
generated
vendored
Normal file
140
node_modules/vue-router/CHANGELOG.md
generated
vendored
Normal file
@ -0,0 +1,140 @@
|
||||
## [3.1.3](https://github.com/vuejs/vue-router/compare/v3.1.2...v3.1.3) (2019-08-30)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **link:** merge event listeners when provided in an anchor ([e0d4dc4](https://github.com/vuejs/vue-router/commit/e0d4dc4)), closes [#2890](https://github.com/vuejs/vue-router/issues/2890)
|
||||
|
||||
### Features
|
||||
|
||||
- **errors:** add stack trace to NavigationDuplicated ([5ef5d73](https://github.com/vuejs/vue-router/commit/5ef5d73)), closes [#2881](https://github.com/vuejs/vue-router/issues/2881)
|
||||
- warn about root paths without a leading slash ([#2591](https://github.com/vuejs/vue-router/issues/2591)) ([7d7e048](https://github.com/vuejs/vue-router/commit/7d7e048)), closes [#2550](https://github.com/vuejs/vue-router/issues/2550) [#2550](https://github.com/vuejs/vue-router/issues/2550)
|
||||
|
||||
## [3.1.2](https://github.com/vuejs/vue-router/compare/v3.1.1...v3.1.2) (2019-08-08)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **types:** prioritize promise based push/replace ([1243e8b](https://github.com/vuejs/vue-router/commit/1243e8b))
|
||||
|
||||
### Reverts
|
||||
|
||||
- "fix(hash): correctly place query if placed before hash ([#2851](https://github.com/vuejs/vue-router/issues/2851))" ([9b30e4c](https://github.com/vuejs/vue-router/commit/9b30e4c)), closes [#2876](https://github.com/vuejs/vue-router/issues/2876). See more information at https://github.com/vuejs/vue-router/issues/2125#issuecomment-519521424
|
||||
|
||||
## [3.1.1](https://github.com/vuejs/vue-router/compare/v3.1.0...v3.1.1) (2019-08-06)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **link:** silence back navigations errors ([59b6da3](https://github.com/vuejs/vue-router/commit/59b6da3))
|
||||
|
||||
# [3.1.0](https://github.com/vuejs/vue-router/compare/v3.0.7...v3.1.0) (2019-08-06)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **abstract history:** allow router.back in abstract mode when 2 consecutive same routes appear in history stack ([#2771](https://github.com/vuejs/vue-router/issues/2771)) ([8910979](https://github.com/vuejs/vue-router/commit/8910979)), closes [#2607](https://github.com/vuejs/vue-router/issues/2607)
|
||||
- **hash:** correctly place query if placed before hash ([#2851](https://github.com/vuejs/vue-router/issues/2851)) ([b7715dc](https://github.com/vuejs/vue-router/commit/b7715dc)), closes [#2125](https://github.com/vuejs/vue-router/issues/2125) [#2262](https://github.com/vuejs/vue-router/issues/2262)
|
||||
- **link:** Fix active links when parent link redirects to child ([#2772](https://github.com/vuejs/vue-router/issues/2772)) ([64785a9](https://github.com/vuejs/vue-router/commit/64785a9)), closes [#2724](https://github.com/vuejs/vue-router/issues/2724)
|
||||
- adapt error to work on IE9 ([527d6d5](https://github.com/vuejs/vue-router/commit/527d6d5))
|
||||
|
||||
### Features
|
||||
|
||||
- **alias:** warn against redundant aliases ([04a02c0](https://github.com/vuejs/vue-router/commit/04a02c0)), closes [#2461](https://github.com/vuejs/vue-router/issues/2461) [#2462](https://github.com/vuejs/vue-router/issues/2462)
|
||||
- **scroll:** handle id selectors starting with a number ([799ceca](https://github.com/vuejs/vue-router/commit/799ceca)), closes [#2163](https://github.com/vuejs/vue-router/issues/2163)
|
||||
- return a promise with push and replace ([#2862](https://github.com/vuejs/vue-router/issues/2862)) ([d907a13](https://github.com/vuejs/vue-router/commit/d907a13)), closes [#1769](https://github.com/vuejs/vue-router/issues/1769) [#1769](https://github.com/vuejs/vue-router/issues/1769)
|
||||
- scoped slot for link ([e289dde](https://github.com/vuejs/vue-router/commit/e289dde))
|
||||
- warn the user for invalid uses of v-slot with Link ([44c63a9](https://github.com/vuejs/vue-router/commit/44c63a9))
|
||||
|
||||
## [3.0.7](https://github.com/vuejs/vue-router/compare/v3.0.6...v3.0.7) (2019-07-03)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- apps loaded from Windows file shares not mapped to network drives ([#2774](https://github.com/vuejs/vue-router/issues/2774)) ([c2c78a3](https://github.com/vuejs/vue-router/commit/c2c78a3))
|
||||
- make callback of next in beforeRouterEnter more consistent ([#2738](https://github.com/vuejs/vue-router/issues/2738)) ([8ac478f](https://github.com/vuejs/vue-router/commit/8ac478f)), closes [#2761](https://github.com/vuejs/vue-router/issues/2761) [#2728](https://github.com/vuejs/vue-router/issues/2728)
|
||||
|
||||
## [3.0.6](https://github.com/vuejs/vue-router/compare/v3.0.5...v3.0.6) (2019-04-17)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- revert [#2713](https://github.com/vuejs/vue-router/issues/2713) ([#2723](https://github.com/vuejs/vue-router/issues/2723)) ([ec6eab7](https://github.com/vuejs/vue-router/commit/ec6eab7)), closes [#2719](https://github.com/vuejs/vue-router/issues/2719)
|
||||
|
||||
## [3.0.5](https://github.com/vuejs/vue-router/compare/v3.0.4...v3.0.5) (2019-04-15)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- push before creating Vue instance ([#2713](https://github.com/vuejs/vue-router/issues/2713)) ([6974a6f](https://github.com/vuejs/vue-router/commit/6974a6f)), closes [#2712](https://github.com/vuejs/vue-router/issues/2712)
|
||||
- **router-view:** add condition to see whether the tree is inactive (fix [#2552](https://github.com/vuejs/vue-router/issues/2552)) ([#2592](https://github.com/vuejs/vue-router/issues/2592)) ([e6d8fd2](https://github.com/vuejs/vue-router/commit/e6d8fd2))
|
||||
- **router-view:** register instance in init hook ([c3abdf6](https://github.com/vuejs/vue-router/commit/c3abdf6)), closes [#2561](https://github.com/vuejs/vue-router/issues/2561) [#2689](https://github.com/vuejs/vue-router/issues/2689) [#2561](https://github.com/vuejs/vue-router/issues/2561) [#2561](https://github.com/vuejs/vue-router/issues/2561)
|
||||
|
||||
## [3.0.4](https://github.com/vuejs/vue-router/compare/v3.0.3...v3.0.4) (2019-04-12)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- prevent memory leaks by removing app references ([#2706](https://github.com/vuejs/vue-router/issues/2706)) ([8056105](https://github.com/vuejs/vue-router/commit/8056105)), closes [#2639](https://github.com/vuejs/vue-router/issues/2639)
|
||||
- **hash:** prevent double decoding ([#2711](https://github.com/vuejs/vue-router/issues/2711)) ([a775fb1](https://github.com/vuejs/vue-router/commit/a775fb1)), closes [#2708](https://github.com/vuejs/vue-router/issues/2708)
|
||||
|
||||
### Features
|
||||
|
||||
- **esm build:** build ES modules for browser ([#2705](https://github.com/vuejs/vue-router/issues/2705)) ([627027f](https://github.com/vuejs/vue-router/commit/627027f))
|
||||
|
||||
## [3.0.3](https://github.com/vuejs/vue-router/compare/v3.0.2...v3.0.3) (2019-04-08)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- removes warning resolving asterisk routes ([e224637](https://github.com/vuejs/vue-router/commit/e224637)), closes [#2505](https://github.com/vuejs/vue-router/issues/2505) [#2505](https://github.com/vuejs/vue-router/issues/2505)
|
||||
- **normalizeLocation:** create a copy with named locations ([#2286](https://github.com/vuejs/vue-router/issues/2286)) ([53cce99](https://github.com/vuejs/vue-router/commit/53cce99)), closes [#2121](https://github.com/vuejs/vue-router/issues/2121)
|
||||
- **resolve:** use current location if not provided ([#2390](https://github.com/vuejs/vue-router/issues/2390)) ([7ff4de4](https://github.com/vuejs/vue-router/commit/7ff4de4)), closes [#2385](https://github.com/vuejs/vue-router/issues/2385)
|
||||
- **types:** allow null/undefined in query params ([ca30a75](https://github.com/vuejs/vue-router/commit/ca30a75)), closes [#2605](https://github.com/vuejs/vue-router/issues/2605)
|
||||
|
||||
## [3.0.2](https://github.com/vuejs/vue-router/compare/v3.0.1...v3.0.2) (2018-11-23)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **errors:** throws with invalid route objects ([#1893](https://github.com/vuejs/vue-router/issues/1893)) ([c837666](https://github.com/vuejs/vue-router/commit/c837666))
|
||||
- fix the test in async.spec.js ([#1953](https://github.com/vuejs/vue-router/issues/1953)) ([4e9e66b](https://github.com/vuejs/vue-router/commit/4e9e66b))
|
||||
- initial url path for non ascii urls ([#2375](https://github.com/vuejs/vue-router/issues/2375)) ([c3b0a33](https://github.com/vuejs/vue-router/commit/c3b0a33))
|
||||
- only setupScroll when support pushState due to possible fallback: false ([#1835](https://github.com/vuejs/vue-router/issues/1835)) ([fac60f6](https://github.com/vuejs/vue-router/commit/fac60f6)), closes [#1834](https://github.com/vuejs/vue-router/issues/1834)
|
||||
- workaround replaceState bug in Safari ([#2295](https://github.com/vuejs/vue-router/issues/2295)) ([3c7d8ab](https://github.com/vuejs/vue-router/commit/3c7d8ab)), closes [#2195](https://github.com/vuejs/vue-router/issues/2195)
|
||||
- **hash:** support unicode in initial route ([8369c6b](https://github.com/vuejs/vue-router/commit/8369c6b))
|
||||
- **history-mode:** correcting indentation in web.config example ([#1948](https://github.com/vuejs/vue-router/issues/1948)) ([4b071f9](https://github.com/vuejs/vue-router/commit/4b071f9))
|
||||
- **match:** use pathMatch for the param of \* routes ([#1995](https://github.com/vuejs/vue-router/issues/1995)) ([ca1fccd](https://github.com/vuejs/vue-router/commit/ca1fccd)), closes [#1994](https://github.com/vuejs/vue-router/issues/1994)
|
||||
|
||||
### Features
|
||||
|
||||
- call scrollBehavior with app context ([#1804](https://github.com/vuejs/vue-router/issues/1804)) ([c93a734](https://github.com/vuejs/vue-router/commit/c93a734))
|
||||
|
||||
## [3.0.1](https://github.com/vuejs/vue-router/compare/v3.0.0...v3.0.1) (2017-10-13)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- fix props-passing regression ([02ff792](https://github.com/vuejs/vue-router/commit/02ff792)), closes [#1800](https://github.com/vuejs/vue-router/issues/1800)
|
||||
|
||||
## [3.0.0](https://github.com/vuejs/vue-router/compare/v2.8.0...v3.0.0) (2017-10-11)
|
||||
|
||||
### Features
|
||||
|
||||
- **typings:** adapt to the new Vue typings ([#1685](https://github.com/vuejs/vue-router/issues/1685)) ([8855e36](https://github.com/vuejs/vue-router/commit/8855e36))
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
- **typings:** It is no longer compatible with the old Vue typings
|
||||
|
||||
## [2.8.0](https://github.com/vuejs/vue-router/compare/v2.7.0...v2.8.0) (2017-10-11)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- allow insllation on extended Vue copies ([f62c5d6](https://github.com/vuejs/vue-router/commit/f62c5d6))
|
||||
- avoid first popstate event with async guard together (fix [#1508](https://github.com/vuejs/vue-router/issues/1508)) ([#1661](https://github.com/vuejs/vue-router/issues/1661)) ([3cbc0f3](https://github.com/vuejs/vue-router/commit/3cbc0f3))
|
||||
- deep clone query when creating routes ([effb114](https://github.com/vuejs/vue-router/commit/effb114)), closes [#1690](https://github.com/vuejs/vue-router/issues/1690)
|
||||
- fix scroll when going back to initial route ([#1586](https://github.com/vuejs/vue-router/issues/1586)) ([c166822](https://github.com/vuejs/vue-router/commit/c166822))
|
||||
- handle null values when comparing objects ([#1568](https://github.com/vuejs/vue-router/issues/1568)) ([4e95bd8](https://github.com/vuejs/vue-router/commit/4e95bd8)), closes [#1566](https://github.com/vuejs/vue-router/issues/1566)
|
||||
- resolve native ES modules ([8a28426](https://github.com/vuejs/vue-router/commit/8a28426))
|
||||
- send props not defined on the route component in \$attrs. Fixes [#1695](https://github.com/vuejs/vue-router/issues/1695). ([#1702](https://github.com/vuejs/vue-router/issues/1702)) ([a722b6a](https://github.com/vuejs/vue-router/commit/a722b6a))
|
||||
|
||||
### Features
|
||||
|
||||
- enhance hashHistory to support scrollBehavior ([#1662](https://github.com/vuejs/vue-router/issues/1662)) ([1422eb5](https://github.com/vuejs/vue-router/commit/1422eb5))
|
||||
- scrollBehavior accept returning a promise ([#1758](https://github.com/vuejs/vue-router/issues/1758)) ([ce13b55](https://github.com/vuejs/vue-router/commit/ce13b55))
|
||||
|
||||
# [2.7.0](https://github.com/vuejs/vue-router/compare/v2.6.0...v2.7.0) (2017-06-29)
|
||||
|
||||
### Features
|
||||
|
||||
- auto resolve ES module default when resolving async components ([d539788](https://github.com/vuejs/vue-router/commit/d539788))
|
21
node_modules/vue-router/LICENSE
generated
vendored
Normal file
21
node_modules/vue-router/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2013-present Evan You
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
82
node_modules/vue-router/README.md
generated
vendored
Normal file
82
node_modules/vue-router/README.md
generated
vendored
Normal file
@ -0,0 +1,82 @@
|
||||
# vue-router [](https://circleci.com/gh/vuejs/vue-router)
|
||||
|
||||
> This is vue-router 3.0 which works only with Vue 2.0. For the 1.x router see the [1.0 branch](https://github.com/vuejs/vue-router/tree/1.0).
|
||||
|
||||
### Introduction
|
||||
|
||||
`vue-router` is the official router for [Vue.js](http://vuejs.org). It deeply integrates with Vue.js core to make building Single Page Applications with Vue.js a breeze. Features include:
|
||||
|
||||
- Nested route/view mapping
|
||||
- Modular, component-based router configuration
|
||||
- Route params, query, wildcards
|
||||
- View transition effects powered by Vue.js' transition system
|
||||
- Fine-grained navigation control
|
||||
- Links with automatic active CSS classes
|
||||
- HTML5 history mode or hash mode, with auto-fallback in IE9
|
||||
- Customizable Scroll Behavior
|
||||
|
||||
Get started with the [documentation](http://router.vuejs.org), or play with the [examples](https://github.com/vuejs/vue-router/tree/dev/examples) (see how to run them below).
|
||||
|
||||
### Development Setup
|
||||
|
||||
``` bash
|
||||
# install deps
|
||||
npm install
|
||||
|
||||
# build dist files
|
||||
npm run build
|
||||
|
||||
# serve examples at localhost:8080
|
||||
npm run dev
|
||||
|
||||
# lint & run all tests
|
||||
npm test
|
||||
|
||||
# serve docs at localhost:8080
|
||||
npm run docs
|
||||
```
|
||||
|
||||
## Releasing
|
||||
|
||||
- `yarn run release`
|
||||
- Ensure tests are passing `yarn run test`
|
||||
- Build dist files `VERSION=<the_version> yarn run build`
|
||||
- Build changelog `yarn run changelog`
|
||||
- Commit dist files `git add dist CHANGELOG.md && git commit -m "[build $VERSION]"`
|
||||
- Publish a new version `npm version $VERSION --message "[release] $VERSION"
|
||||
- Push tags `git push origin refs/tags/v$VERSION && git push`
|
||||
- Publish to npm `npm publish`
|
||||
|
||||
## Questions
|
||||
|
||||
For questions and support please use the [Discord chat server](https://chat.vuejs.org) or [the official forum](http://forum.vuejs.org). The issue list of this repo is **exclusively** for bug reports and feature requests.
|
||||
|
||||
## Issues
|
||||
|
||||
Please make sure to read the [Issue Reporting Checklist](https://github.com/vuejs/vue/blob/dev/.github/CONTRIBUTING.md#issue-reporting-guidelines) before opening an issue. Issues not conforming to the guidelines may be closed immediately.
|
||||
|
||||
## Contribution
|
||||
|
||||
Please make sure to read the [Contributing Guide](https://github.com/vuejs/vue/blob/dev/.github/CONTRIBUTING.md) before making a pull request.
|
||||
|
||||
## Changelog
|
||||
|
||||
Details changes for each release are documented in the [release notes](https://github.com/vuejs/vue-router/releases).
|
||||
|
||||
## Stay In Touch
|
||||
|
||||
- For latest releases and announcements, follow on Twitter: [@vuejs](https://twitter.com/vuejs)
|
||||
|
||||
## License
|
||||
|
||||
[MIT](http://opensource.org/licenses/MIT)
|
||||
|
||||
Copyright (c) 2013-present Evan You
|
||||
|
||||
## Special Thanks
|
||||
|
||||
<a href="https://www.browserstack.com">
|
||||
<img src="/assets/browserstack-logo-600x315.png" height="80" title="BrowserStack Logo" alt="BrowserStack Logo" />
|
||||
</a>
|
||||
|
||||
Special thanks to [BrowserStack](https://www.browserstack.com) for letting the maintainers use their service to debug browser specific issues.
|
2884
node_modules/vue-router/dist/vue-router.common.js
generated
vendored
Normal file
2884
node_modules/vue-router/dist/vue-router.common.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2834
node_modules/vue-router/dist/vue-router.esm.browser.js
generated
vendored
Normal file
2834
node_modules/vue-router/dist/vue-router.esm.browser.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
6
node_modules/vue-router/dist/vue-router.esm.browser.min.js
generated
vendored
Normal file
6
node_modules/vue-router/dist/vue-router.esm.browser.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2882
node_modules/vue-router/dist/vue-router.esm.js
generated
vendored
Normal file
2882
node_modules/vue-router/dist/vue-router.esm.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2890
node_modules/vue-router/dist/vue-router.js
generated
vendored
Normal file
2890
node_modules/vue-router/dist/vue-router.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
6
node_modules/vue-router/dist/vue-router.min.js
generated
vendored
Normal file
6
node_modules/vue-router/dist/vue-router.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
107
node_modules/vue-router/package.json
generated
vendored
Normal file
107
node_modules/vue-router/package.json
generated
vendored
Normal file
@ -0,0 +1,107 @@
|
||||
{
|
||||
"name": "vue-router",
|
||||
"version": "3.1.3",
|
||||
"description": "Official router for Vue.js 2",
|
||||
"author": "Evan You",
|
||||
"license": "MIT",
|
||||
"main": "dist/vue-router.common.js",
|
||||
"module": "dist/vue-router.esm.js",
|
||||
"unpkg": "dist/vue-router.js",
|
||||
"jsdelivr": "dist/vue-router.js",
|
||||
"sideEffects": false,
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/vuejs/vue-router.git"
|
||||
},
|
||||
"typings": "types/index.d.ts",
|
||||
"files": [
|
||||
"src/*.js",
|
||||
"dist/*.js",
|
||||
"types/*.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"vue",
|
||||
"router",
|
||||
"routing"
|
||||
],
|
||||
"scripts": {
|
||||
"dev": "node examples/server.js",
|
||||
"dev:dist": "rollup -wm -c build/rollup.dev.config.js",
|
||||
"build": "node build/build.js",
|
||||
"lint": "eslint src examples test",
|
||||
"test": "npm run lint && npm run flow && npm run test:unit && npm run test:e2e && npm run test:types",
|
||||
"flow": "flow check",
|
||||
"test:unit": "jasmine JASMINE_CONFIG_PATH=test/unit/jasmine.json",
|
||||
"test:e2e": "node test/e2e/runner.js",
|
||||
"test:e2e:ci": "node test/e2e/runner.js --local -e ie,android44 -c test/e2e/nightwatch.browserstack.js test/e2e/specs/active-links.js",
|
||||
"test:e2e:ff": "node test/e2e/runner.js -e firefox -c test/e2e/nightwatch.config.js",
|
||||
"test:e2e:ie9": "node test/e2e/runner.js --local -e ie9 -c test/e2e/nightwatch.browserstack.js --skiptags history,ie9-fail",
|
||||
"test:types": "tsc -p types/test",
|
||||
"docs": "vuepress dev docs",
|
||||
"docs:build": "vuepress build docs",
|
||||
"changelog": "conventional-changelog -p angular -r 2 -i CHANGELOG.md -s",
|
||||
"release": "bash scripts/release.sh"
|
||||
},
|
||||
"gitHooks": {
|
||||
"pre-commit": "lint-staged",
|
||||
"commit-msg": "node scripts/verifyCommitMsg.js"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{js,vue}": [
|
||||
"eslint --fix",
|
||||
"git add"
|
||||
]
|
||||
},
|
||||
"devDependencies": {
|
||||
"axios": "^0.19.0",
|
||||
"babel-core": "^6.24.1",
|
||||
"babel-eslint": "^10.0.2",
|
||||
"babel-loader": "^7.1.3",
|
||||
"babel-plugin-syntax-dynamic-import": "^6.18.0",
|
||||
"babel-preset-env": "^1.6.1",
|
||||
"babel-preset-flow-vue": "^1.0.0",
|
||||
"browserstack-local": "^1.4.0",
|
||||
"buble": "^0.19.8",
|
||||
"chromedriver": "^76.0.0",
|
||||
"conventional-changelog-cli": "^2.0.11",
|
||||
"cross-spawn": "^6.0.5",
|
||||
"css-loader": "^2.1.1",
|
||||
"dotenv": "^8.0.0",
|
||||
"es6-promise": "^4.2.8",
|
||||
"eslint": "^4.19.1",
|
||||
"eslint-plugin-flowtype": "^2.46.1",
|
||||
"eslint-plugin-jasmine": "^2.10.1",
|
||||
"eslint-plugin-vue-libs": "^2.1.0",
|
||||
"express": "^4.17.1",
|
||||
"express-urlrewrite": "^1.2.0",
|
||||
"flow-bin": "^0.66.0",
|
||||
"geckodriver": "^1.16.2",
|
||||
"jasmine": "2.8.0",
|
||||
"lint-staged": "^8.2.0",
|
||||
"nightwatch": "^1.1.13",
|
||||
"nightwatch-helpers": "^1.0.0",
|
||||
"path-to-regexp": "^1.7.0",
|
||||
"rollup": "^1.20.1",
|
||||
"rollup-plugin-buble": "^0.19.8",
|
||||
"rollup-plugin-commonjs": "^10.0.2",
|
||||
"rollup-plugin-flow-no-whitespace": "^1.0.0",
|
||||
"rollup-plugin-node-resolve": "^5.2.0",
|
||||
"rollup-plugin-replace": "^2.0.0",
|
||||
"rollup-watch": "^4.0.0",
|
||||
"selenium-server": "^3.141.59",
|
||||
"terser": "^4.2.0",
|
||||
"typescript": "^3.5.2",
|
||||
"vue": "^2.5.16",
|
||||
"vue-loader": "^15.2.1",
|
||||
"vue-template-compiler": "^2.5.16",
|
||||
"vuepress": "^0.14.11",
|
||||
"vuepress-theme-vue": "^1.1.0",
|
||||
"webpack": "^4.35.2",
|
||||
"webpack-dev-middleware": "^3.7.0",
|
||||
"yorkie": "^2.0.0"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/vuejs/vue-router/issues"
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/vue-router#readme"
|
||||
}
|
200
node_modules/vue-router/src/create-matcher.js
generated
vendored
Normal file
200
node_modules/vue-router/src/create-matcher.js
generated
vendored
Normal file
@ -0,0 +1,200 @@
|
||||
/* @flow */
|
||||
|
||||
import type VueRouter from './index'
|
||||
import { resolvePath } from './util/path'
|
||||
import { assert, warn } from './util/warn'
|
||||
import { createRoute } from './util/route'
|
||||
import { fillParams } from './util/params'
|
||||
import { createRouteMap } from './create-route-map'
|
||||
import { normalizeLocation } from './util/location'
|
||||
|
||||
export type Matcher = {
|
||||
match: (raw: RawLocation, current?: Route, redirectedFrom?: Location) => Route;
|
||||
addRoutes: (routes: Array<RouteConfig>) => void;
|
||||
};
|
||||
|
||||
export function createMatcher (
|
||||
routes: Array<RouteConfig>,
|
||||
router: VueRouter
|
||||
): Matcher {
|
||||
const { pathList, pathMap, nameMap } = createRouteMap(routes)
|
||||
|
||||
function addRoutes (routes) {
|
||||
createRouteMap(routes, pathList, pathMap, nameMap)
|
||||
}
|
||||
|
||||
function match (
|
||||
raw: RawLocation,
|
||||
currentRoute?: Route,
|
||||
redirectedFrom?: Location
|
||||
): Route {
|
||||
const location = normalizeLocation(raw, currentRoute, false, router)
|
||||
const { name } = location
|
||||
|
||||
if (name) {
|
||||
const record = nameMap[name]
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
warn(record, `Route with name '${name}' does not exist`)
|
||||
}
|
||||
if (!record) return _createRoute(null, location)
|
||||
const paramNames = record.regex.keys
|
||||
.filter(key => !key.optional)
|
||||
.map(key => key.name)
|
||||
|
||||
if (typeof location.params !== 'object') {
|
||||
location.params = {}
|
||||
}
|
||||
|
||||
if (currentRoute && typeof currentRoute.params === 'object') {
|
||||
for (const key in currentRoute.params) {
|
||||
if (!(key in location.params) && paramNames.indexOf(key) > -1) {
|
||||
location.params[key] = currentRoute.params[key]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
location.path = fillParams(record.path, location.params, `named route "${name}"`)
|
||||
return _createRoute(record, location, redirectedFrom)
|
||||
} else if (location.path) {
|
||||
location.params = {}
|
||||
for (let i = 0; i < pathList.length; i++) {
|
||||
const path = pathList[i]
|
||||
const record = pathMap[path]
|
||||
if (matchRoute(record.regex, location.path, location.params)) {
|
||||
return _createRoute(record, location, redirectedFrom)
|
||||
}
|
||||
}
|
||||
}
|
||||
// no match
|
||||
return _createRoute(null, location)
|
||||
}
|
||||
|
||||
function redirect (
|
||||
record: RouteRecord,
|
||||
location: Location
|
||||
): Route {
|
||||
const originalRedirect = record.redirect
|
||||
let redirect = typeof originalRedirect === 'function'
|
||||
? originalRedirect(createRoute(record, location, null, router))
|
||||
: originalRedirect
|
||||
|
||||
if (typeof redirect === 'string') {
|
||||
redirect = { path: redirect }
|
||||
}
|
||||
|
||||
if (!redirect || typeof redirect !== 'object') {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
warn(
|
||||
false, `invalid redirect option: ${JSON.stringify(redirect)}`
|
||||
)
|
||||
}
|
||||
return _createRoute(null, location)
|
||||
}
|
||||
|
||||
const re: Object = redirect
|
||||
const { name, path } = re
|
||||
let { query, hash, params } = location
|
||||
query = re.hasOwnProperty('query') ? re.query : query
|
||||
hash = re.hasOwnProperty('hash') ? re.hash : hash
|
||||
params = re.hasOwnProperty('params') ? re.params : params
|
||||
|
||||
if (name) {
|
||||
// resolved named direct
|
||||
const targetRecord = nameMap[name]
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
assert(targetRecord, `redirect failed: named route "${name}" not found.`)
|
||||
}
|
||||
return match({
|
||||
_normalized: true,
|
||||
name,
|
||||
query,
|
||||
hash,
|
||||
params
|
||||
}, undefined, location)
|
||||
} else if (path) {
|
||||
// 1. resolve relative redirect
|
||||
const rawPath = resolveRecordPath(path, record)
|
||||
// 2. resolve params
|
||||
const resolvedPath = fillParams(rawPath, params, `redirect route with path "${rawPath}"`)
|
||||
// 3. rematch with existing query and hash
|
||||
return match({
|
||||
_normalized: true,
|
||||
path: resolvedPath,
|
||||
query,
|
||||
hash
|
||||
}, undefined, location)
|
||||
} else {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
warn(false, `invalid redirect option: ${JSON.stringify(redirect)}`)
|
||||
}
|
||||
return _createRoute(null, location)
|
||||
}
|
||||
}
|
||||
|
||||
function alias (
|
||||
record: RouteRecord,
|
||||
location: Location,
|
||||
matchAs: string
|
||||
): Route {
|
||||
const aliasedPath = fillParams(matchAs, location.params, `aliased route with path "${matchAs}"`)
|
||||
const aliasedMatch = match({
|
||||
_normalized: true,
|
||||
path: aliasedPath
|
||||
})
|
||||
if (aliasedMatch) {
|
||||
const matched = aliasedMatch.matched
|
||||
const aliasedRecord = matched[matched.length - 1]
|
||||
location.params = aliasedMatch.params
|
||||
return _createRoute(aliasedRecord, location)
|
||||
}
|
||||
return _createRoute(null, location)
|
||||
}
|
||||
|
||||
function _createRoute (
|
||||
record: ?RouteRecord,
|
||||
location: Location,
|
||||
redirectedFrom?: Location
|
||||
): Route {
|
||||
if (record && record.redirect) {
|
||||
return redirect(record, redirectedFrom || location)
|
||||
}
|
||||
if (record && record.matchAs) {
|
||||
return alias(record, location, record.matchAs)
|
||||
}
|
||||
return createRoute(record, location, redirectedFrom, router)
|
||||
}
|
||||
|
||||
return {
|
||||
match,
|
||||
addRoutes
|
||||
}
|
||||
}
|
||||
|
||||
function matchRoute (
|
||||
regex: RouteRegExp,
|
||||
path: string,
|
||||
params: Object
|
||||
): boolean {
|
||||
const m = path.match(regex)
|
||||
|
||||
if (!m) {
|
||||
return false
|
||||
} else if (!params) {
|
||||
return true
|
||||
}
|
||||
|
||||
for (let i = 1, len = m.length; i < len; ++i) {
|
||||
const key = regex.keys[i - 1]
|
||||
const val = typeof m[i] === 'string' ? decodeURIComponent(m[i]) : m[i]
|
||||
if (key) {
|
||||
// Fix #1994: using * with props: true generates a param named 0
|
||||
params[key.name || 'pathMatch'] = val
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
function resolveRecordPath (path: string, record: RouteRecord): string {
|
||||
return resolvePath(path, record.parent ? record.parent.path : '/', true)
|
||||
}
|
205
node_modules/vue-router/src/create-route-map.js
generated
vendored
Normal file
205
node_modules/vue-router/src/create-route-map.js
generated
vendored
Normal file
@ -0,0 +1,205 @@
|
||||
/* @flow */
|
||||
|
||||
import Regexp from 'path-to-regexp'
|
||||
import { cleanPath } from './util/path'
|
||||
import { assert, warn } from './util/warn'
|
||||
|
||||
export function createRouteMap (
|
||||
routes: Array<RouteConfig>,
|
||||
oldPathList?: Array<string>,
|
||||
oldPathMap?: Dictionary<RouteRecord>,
|
||||
oldNameMap?: Dictionary<RouteRecord>
|
||||
): {
|
||||
pathList: Array<string>,
|
||||
pathMap: Dictionary<RouteRecord>,
|
||||
nameMap: Dictionary<RouteRecord>
|
||||
} {
|
||||
// the path list is used to control path matching priority
|
||||
const pathList: Array<string> = oldPathList || []
|
||||
// $flow-disable-line
|
||||
const pathMap: Dictionary<RouteRecord> = oldPathMap || Object.create(null)
|
||||
// $flow-disable-line
|
||||
const nameMap: Dictionary<RouteRecord> = oldNameMap || Object.create(null)
|
||||
|
||||
routes.forEach(route => {
|
||||
addRouteRecord(pathList, pathMap, nameMap, route)
|
||||
})
|
||||
|
||||
// ensure wildcard routes are always at the end
|
||||
for (let i = 0, l = pathList.length; i < l; i++) {
|
||||
if (pathList[i] === '*') {
|
||||
pathList.push(pathList.splice(i, 1)[0])
|
||||
l--
|
||||
i--
|
||||
}
|
||||
}
|
||||
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
// warn if routes do not include leading slashes
|
||||
const found = pathList
|
||||
// check for missing leading slash
|
||||
.filter(path => path && path.charAt(0) !== '*' && path.charAt(0) !== '/')
|
||||
|
||||
if (found.length > 0) {
|
||||
const pathNames = found.map(path => `- ${path}`).join('\n')
|
||||
warn(false, `Non-nested routes must include a leading slash character. Fix the following routes: \n${pathNames}`)
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
pathList,
|
||||
pathMap,
|
||||
nameMap
|
||||
}
|
||||
}
|
||||
|
||||
function addRouteRecord (
|
||||
pathList: Array<string>,
|
||||
pathMap: Dictionary<RouteRecord>,
|
||||
nameMap: Dictionary<RouteRecord>,
|
||||
route: RouteConfig,
|
||||
parent?: RouteRecord,
|
||||
matchAs?: string
|
||||
) {
|
||||
const { path, name } = route
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
assert(path != null, `"path" is required in a route configuration.`)
|
||||
assert(
|
||||
typeof route.component !== 'string',
|
||||
`route config "component" for path: ${String(
|
||||
path || name
|
||||
)} cannot be a ` + `string id. Use an actual component instead.`
|
||||
)
|
||||
}
|
||||
|
||||
const pathToRegexpOptions: PathToRegexpOptions =
|
||||
route.pathToRegexpOptions || {}
|
||||
const normalizedPath = normalizePath(path, parent, pathToRegexpOptions.strict)
|
||||
|
||||
if (typeof route.caseSensitive === 'boolean') {
|
||||
pathToRegexpOptions.sensitive = route.caseSensitive
|
||||
}
|
||||
|
||||
const record: RouteRecord = {
|
||||
path: normalizedPath,
|
||||
regex: compileRouteRegex(normalizedPath, pathToRegexpOptions),
|
||||
components: route.components || { default: route.component },
|
||||
instances: {},
|
||||
name,
|
||||
parent,
|
||||
matchAs,
|
||||
redirect: route.redirect,
|
||||
beforeEnter: route.beforeEnter,
|
||||
meta: route.meta || {},
|
||||
props:
|
||||
route.props == null
|
||||
? {}
|
||||
: route.components
|
||||
? route.props
|
||||
: { default: route.props }
|
||||
}
|
||||
|
||||
if (route.children) {
|
||||
// Warn if route is named, does not redirect and has a default child route.
|
||||
// If users navigate to this route by name, the default child will
|
||||
// not be rendered (GH Issue #629)
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
if (
|
||||
route.name &&
|
||||
!route.redirect &&
|
||||
route.children.some(child => /^\/?$/.test(child.path))
|
||||
) {
|
||||
warn(
|
||||
false,
|
||||
`Named Route '${route.name}' has a default child route. ` +
|
||||
`When navigating to this named route (:to="{name: '${
|
||||
route.name
|
||||
}'"), ` +
|
||||
`the default child route will not be rendered. Remove the name from ` +
|
||||
`this route and use the name of the default child route for named ` +
|
||||
`links instead.`
|
||||
)
|
||||
}
|
||||
}
|
||||
route.children.forEach(child => {
|
||||
const childMatchAs = matchAs
|
||||
? cleanPath(`${matchAs}/${child.path}`)
|
||||
: undefined
|
||||
addRouteRecord(pathList, pathMap, nameMap, child, record, childMatchAs)
|
||||
})
|
||||
}
|
||||
|
||||
if (!pathMap[record.path]) {
|
||||
pathList.push(record.path)
|
||||
pathMap[record.path] = record
|
||||
}
|
||||
|
||||
if (route.alias !== undefined) {
|
||||
const aliases = Array.isArray(route.alias) ? route.alias : [route.alias]
|
||||
for (let i = 0; i < aliases.length; ++i) {
|
||||
const alias = aliases[i]
|
||||
if (process.env.NODE_ENV !== 'production' && alias === path) {
|
||||
warn(
|
||||
false,
|
||||
`Found an alias with the same value as the path: "${path}". You have to remove that alias. It will be ignored in development.`
|
||||
)
|
||||
// skip in dev to make it work
|
||||
continue
|
||||
}
|
||||
|
||||
const aliasRoute = {
|
||||
path: alias,
|
||||
children: route.children
|
||||
}
|
||||
addRouteRecord(
|
||||
pathList,
|
||||
pathMap,
|
||||
nameMap,
|
||||
aliasRoute,
|
||||
parent,
|
||||
record.path || '/' // matchAs
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (name) {
|
||||
if (!nameMap[name]) {
|
||||
nameMap[name] = record
|
||||
} else if (process.env.NODE_ENV !== 'production' && !matchAs) {
|
||||
warn(
|
||||
false,
|
||||
`Duplicate named routes definition: ` +
|
||||
`{ name: "${name}", path: "${record.path}" }`
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function compileRouteRegex (
|
||||
path: string,
|
||||
pathToRegexpOptions: PathToRegexpOptions
|
||||
): RouteRegExp {
|
||||
const regex = Regexp(path, [], pathToRegexpOptions)
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
const keys: any = Object.create(null)
|
||||
regex.keys.forEach(key => {
|
||||
warn(
|
||||
!keys[key.name],
|
||||
`Duplicate param keys in route with path: "${path}"`
|
||||
)
|
||||
keys[key.name] = true
|
||||
})
|
||||
}
|
||||
return regex
|
||||
}
|
||||
|
||||
function normalizePath (
|
||||
path: string,
|
||||
parent?: RouteRecord,
|
||||
strict?: boolean
|
||||
): string {
|
||||
if (!strict) path = path.replace(/\/$/, '')
|
||||
if (path[0] === '/') return path
|
||||
if (parent == null) return path
|
||||
return cleanPath(`${parent.path}/${path}`)
|
||||
}
|
262
node_modules/vue-router/src/index.js
generated
vendored
Normal file
262
node_modules/vue-router/src/index.js
generated
vendored
Normal file
@ -0,0 +1,262 @@
|
||||
/* @flow */
|
||||
|
||||
import { install } from './install'
|
||||
import { START } from './util/route'
|
||||
import { assert } from './util/warn'
|
||||
import { inBrowser } from './util/dom'
|
||||
import { cleanPath } from './util/path'
|
||||
import { createMatcher } from './create-matcher'
|
||||
import { normalizeLocation } from './util/location'
|
||||
import { supportsPushState } from './util/push-state'
|
||||
|
||||
import { HashHistory } from './history/hash'
|
||||
import { HTML5History } from './history/html5'
|
||||
import { AbstractHistory } from './history/abstract'
|
||||
|
||||
import type { Matcher } from './create-matcher'
|
||||
|
||||
export default class VueRouter {
|
||||
static install: () => void;
|
||||
static version: string;
|
||||
|
||||
app: any;
|
||||
apps: Array<any>;
|
||||
ready: boolean;
|
||||
readyCbs: Array<Function>;
|
||||
options: RouterOptions;
|
||||
mode: string;
|
||||
history: HashHistory | HTML5History | AbstractHistory;
|
||||
matcher: Matcher;
|
||||
fallback: boolean;
|
||||
beforeHooks: Array<?NavigationGuard>;
|
||||
resolveHooks: Array<?NavigationGuard>;
|
||||
afterHooks: Array<?AfterNavigationHook>;
|
||||
|
||||
constructor (options: RouterOptions = {}) {
|
||||
this.app = null
|
||||
this.apps = []
|
||||
this.options = options
|
||||
this.beforeHooks = []
|
||||
this.resolveHooks = []
|
||||
this.afterHooks = []
|
||||
this.matcher = createMatcher(options.routes || [], this)
|
||||
|
||||
let mode = options.mode || 'hash'
|
||||
this.fallback = mode === 'history' && !supportsPushState && options.fallback !== false
|
||||
if (this.fallback) {
|
||||
mode = 'hash'
|
||||
}
|
||||
if (!inBrowser) {
|
||||
mode = 'abstract'
|
||||
}
|
||||
this.mode = mode
|
||||
|
||||
switch (mode) {
|
||||
case 'history':
|
||||
this.history = new HTML5History(this, options.base)
|
||||
break
|
||||
case 'hash':
|
||||
this.history = new HashHistory(this, options.base, this.fallback)
|
||||
break
|
||||
case 'abstract':
|
||||
this.history = new AbstractHistory(this, options.base)
|
||||
break
|
||||
default:
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
assert(false, `invalid mode: ${mode}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
match (
|
||||
raw: RawLocation,
|
||||
current?: Route,
|
||||
redirectedFrom?: Location
|
||||
): Route {
|
||||
return this.matcher.match(raw, current, redirectedFrom)
|
||||
}
|
||||
|
||||
get currentRoute (): ?Route {
|
||||
return this.history && this.history.current
|
||||
}
|
||||
|
||||
init (app: any /* Vue component instance */) {
|
||||
process.env.NODE_ENV !== 'production' && assert(
|
||||
install.installed,
|
||||
`not installed. Make sure to call \`Vue.use(VueRouter)\` ` +
|
||||
`before creating root instance.`
|
||||
)
|
||||
|
||||
this.apps.push(app)
|
||||
|
||||
// set up app destroyed handler
|
||||
// https://github.com/vuejs/vue-router/issues/2639
|
||||
app.$once('hook:destroyed', () => {
|
||||
// clean out app from this.apps array once destroyed
|
||||
const index = this.apps.indexOf(app)
|
||||
if (index > -1) this.apps.splice(index, 1)
|
||||
// ensure we still have a main app or null if no apps
|
||||
// we do not release the router so it can be reused
|
||||
if (this.app === app) this.app = this.apps[0] || null
|
||||
})
|
||||
|
||||
// main app previously initialized
|
||||
// return as we don't need to set up new history listener
|
||||
if (this.app) {
|
||||
return
|
||||
}
|
||||
|
||||
this.app = app
|
||||
|
||||
const history = this.history
|
||||
|
||||
if (history instanceof HTML5History) {
|
||||
history.transitionTo(history.getCurrentLocation())
|
||||
} else if (history instanceof HashHistory) {
|
||||
const setupHashListener = () => {
|
||||
history.setupListeners()
|
||||
}
|
||||
history.transitionTo(
|
||||
history.getCurrentLocation(),
|
||||
setupHashListener,
|
||||
setupHashListener
|
||||
)
|
||||
}
|
||||
|
||||
history.listen(route => {
|
||||
this.apps.forEach((app) => {
|
||||
app._route = route
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
beforeEach (fn: Function): Function {
|
||||
return registerHook(this.beforeHooks, fn)
|
||||
}
|
||||
|
||||
beforeResolve (fn: Function): Function {
|
||||
return registerHook(this.resolveHooks, fn)
|
||||
}
|
||||
|
||||
afterEach (fn: Function): Function {
|
||||
return registerHook(this.afterHooks, fn)
|
||||
}
|
||||
|
||||
onReady (cb: Function, errorCb?: Function) {
|
||||
this.history.onReady(cb, errorCb)
|
||||
}
|
||||
|
||||
onError (errorCb: Function) {
|
||||
this.history.onError(errorCb)
|
||||
}
|
||||
|
||||
push (location: RawLocation, onComplete?: Function, onAbort?: Function) {
|
||||
// $flow-disable-line
|
||||
if (!onComplete && !onAbort && typeof Promise !== 'undefined') {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.history.push(location, resolve, reject)
|
||||
})
|
||||
} else {
|
||||
this.history.push(location, onComplete, onAbort)
|
||||
}
|
||||
}
|
||||
|
||||
replace (location: RawLocation, onComplete?: Function, onAbort?: Function) {
|
||||
// $flow-disable-line
|
||||
if (!onComplete && !onAbort && typeof Promise !== 'undefined') {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.history.replace(location, resolve, reject)
|
||||
})
|
||||
} else {
|
||||
this.history.replace(location, onComplete, onAbort)
|
||||
}
|
||||
}
|
||||
|
||||
go (n: number) {
|
||||
this.history.go(n)
|
||||
}
|
||||
|
||||
back () {
|
||||
this.go(-1)
|
||||
}
|
||||
|
||||
forward () {
|
||||
this.go(1)
|
||||
}
|
||||
|
||||
getMatchedComponents (to?: RawLocation | Route): Array<any> {
|
||||
const route: any = to
|
||||
? to.matched
|
||||
? to
|
||||
: this.resolve(to).route
|
||||
: this.currentRoute
|
||||
if (!route) {
|
||||
return []
|
||||
}
|
||||
return [].concat.apply([], route.matched.map(m => {
|
||||
return Object.keys(m.components).map(key => {
|
||||
return m.components[key]
|
||||
})
|
||||
}))
|
||||
}
|
||||
|
||||
resolve (
|
||||
to: RawLocation,
|
||||
current?: Route,
|
||||
append?: boolean
|
||||
): {
|
||||
location: Location,
|
||||
route: Route,
|
||||
href: string,
|
||||
// for backwards compat
|
||||
normalizedTo: Location,
|
||||
resolved: Route
|
||||
} {
|
||||
current = current || this.history.current
|
||||
const location = normalizeLocation(
|
||||
to,
|
||||
current,
|
||||
append,
|
||||
this
|
||||
)
|
||||
const route = this.match(location, current)
|
||||
const fullPath = route.redirectedFrom || route.fullPath
|
||||
const base = this.history.base
|
||||
const href = createHref(base, fullPath, this.mode)
|
||||
return {
|
||||
location,
|
||||
route,
|
||||
href,
|
||||
// for backwards compat
|
||||
normalizedTo: location,
|
||||
resolved: route
|
||||
}
|
||||
}
|
||||
|
||||
addRoutes (routes: Array<RouteConfig>) {
|
||||
this.matcher.addRoutes(routes)
|
||||
if (this.history.current !== START) {
|
||||
this.history.transitionTo(this.history.getCurrentLocation())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function registerHook (list: Array<any>, fn: Function): Function {
|
||||
list.push(fn)
|
||||
return () => {
|
||||
const i = list.indexOf(fn)
|
||||
if (i > -1) list.splice(i, 1)
|
||||
}
|
||||
}
|
||||
|
||||
function createHref (base: string, fullPath: string, mode) {
|
||||
var path = mode === 'hash' ? '#' + fullPath : fullPath
|
||||
return base ? cleanPath(base + '/' + path) : path
|
||||
}
|
||||
|
||||
VueRouter.install = install
|
||||
VueRouter.version = '__VERSION__'
|
||||
|
||||
if (inBrowser && window.Vue) {
|
||||
window.Vue.use(VueRouter)
|
||||
}
|
52
node_modules/vue-router/src/install.js
generated
vendored
Normal file
52
node_modules/vue-router/src/install.js
generated
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
import View from './components/view'
|
||||
import Link from './components/link'
|
||||
|
||||
export let _Vue
|
||||
|
||||
export function install (Vue) {
|
||||
if (install.installed && _Vue === Vue) return
|
||||
install.installed = true
|
||||
|
||||
_Vue = Vue
|
||||
|
||||
const isDef = v => v !== undefined
|
||||
|
||||
const registerInstance = (vm, callVal) => {
|
||||
let i = vm.$options._parentVnode
|
||||
if (isDef(i) && isDef(i = i.data) && isDef(i = i.registerRouteInstance)) {
|
||||
i(vm, callVal)
|
||||
}
|
||||
}
|
||||
|
||||
Vue.mixin({
|
||||
beforeCreate () {
|
||||
if (isDef(this.$options.router)) {
|
||||
this._routerRoot = this
|
||||
this._router = this.$options.router
|
||||
this._router.init(this)
|
||||
Vue.util.defineReactive(this, '_route', this._router.history.current)
|
||||
} else {
|
||||
this._routerRoot = (this.$parent && this.$parent._routerRoot) || this
|
||||
}
|
||||
registerInstance(this, this)
|
||||
},
|
||||
destroyed () {
|
||||
registerInstance(this)
|
||||
}
|
||||
})
|
||||
|
||||
Object.defineProperty(Vue.prototype, '$router', {
|
||||
get () { return this._routerRoot._router }
|
||||
})
|
||||
|
||||
Object.defineProperty(Vue.prototype, '$route', {
|
||||
get () { return this._routerRoot._route }
|
||||
})
|
||||
|
||||
Vue.component('RouterView', View)
|
||||
Vue.component('RouterLink', Link)
|
||||
|
||||
const strats = Vue.config.optionMergeStrategies
|
||||
// use the same hook merging strategy for route hooks
|
||||
strats.beforeRouteEnter = strats.beforeRouteLeave = strats.beforeRouteUpdate = strats.created
|
||||
}
|
16
node_modules/vue-router/types/index.d.ts
generated
vendored
Normal file
16
node_modules/vue-router/types/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
import './vue'
|
||||
import { VueRouter } from './router'
|
||||
|
||||
export default VueRouter
|
||||
|
||||
export {
|
||||
RouterMode,
|
||||
RawLocation,
|
||||
RedirectOption,
|
||||
RouterOptions,
|
||||
RouteConfig,
|
||||
RouteRecord,
|
||||
Location,
|
||||
Route,
|
||||
NavigationGuard
|
||||
} from './router'
|
145
node_modules/vue-router/types/router.d.ts
generated
vendored
Normal file
145
node_modules/vue-router/types/router.d.ts
generated
vendored
Normal file
@ -0,0 +1,145 @@
|
||||
import Vue, { ComponentOptions, PluginFunction, AsyncComponent } from 'vue'
|
||||
|
||||
type Component = ComponentOptions<Vue> | typeof Vue | AsyncComponent
|
||||
type Dictionary < T > = { [key: string]: T }
|
||||
type ErrorHandler = (err: Error) => void
|
||||
|
||||
export type RouterMode = 'hash' | 'history' | 'abstract'
|
||||
export type RawLocation = string | Location
|
||||
export type RedirectOption = RawLocation | ((to: Route) => RawLocation)
|
||||
export type NavigationGuard < V extends Vue = Vue > = (
|
||||
to: Route,
|
||||
from: Route,
|
||||
next: (to?: RawLocation | false | ((vm: V) => any) | void) => void
|
||||
) => any
|
||||
|
||||
export declare class VueRouter {
|
||||
constructor(options?: RouterOptions)
|
||||
|
||||
app: Vue
|
||||
mode: RouterMode
|
||||
currentRoute: Route
|
||||
|
||||
beforeEach(guard: NavigationGuard): Function
|
||||
beforeResolve(guard: NavigationGuard): Function
|
||||
afterEach(hook: (to: Route, from: Route) => any): Function
|
||||
push(location: RawLocation): Promise<Route>
|
||||
replace(location: RawLocation): Promise<Route>
|
||||
push(
|
||||
location: RawLocation,
|
||||
onComplete?: Function,
|
||||
onAbort?: ErrorHandler
|
||||
): void
|
||||
replace(
|
||||
location: RawLocation,
|
||||
onComplete?: Function,
|
||||
onAbort?: ErrorHandler
|
||||
): void
|
||||
go(n: number): void
|
||||
back(): void
|
||||
forward(): void
|
||||
getMatchedComponents(to?: RawLocation | Route): Component[]
|
||||
onReady(cb: Function, errorCb?: ErrorHandler): void
|
||||
onError(cb: ErrorHandler): void
|
||||
addRoutes(routes: RouteConfig[]): void
|
||||
resolve(
|
||||
to: RawLocation,
|
||||
current?: Route,
|
||||
append?: boolean
|
||||
): {
|
||||
location: Location
|
||||
route: Route
|
||||
href: string
|
||||
// backwards compat
|
||||
normalizedTo: Location
|
||||
resolved: Route
|
||||
}
|
||||
|
||||
static install: PluginFunction<never>
|
||||
}
|
||||
|
||||
type Position = { x: number; y: number }
|
||||
type PositionResult = Position | { selector: string; offset?: Position } | void
|
||||
|
||||
export interface RouterOptions {
|
||||
routes?: RouteConfig[]
|
||||
mode?: RouterMode
|
||||
fallback?: boolean
|
||||
base?: string
|
||||
linkActiveClass?: string
|
||||
linkExactActiveClass?: string
|
||||
parseQuery?: (query: string) => Object
|
||||
stringifyQuery?: (query: Object) => string
|
||||
scrollBehavior?: (
|
||||
to: Route,
|
||||
from: Route,
|
||||
savedPosition: Position | void
|
||||
) => PositionResult | Promise<PositionResult>
|
||||
}
|
||||
|
||||
type RoutePropsFunction = (route: Route) => Object
|
||||
|
||||
export interface PathToRegexpOptions {
|
||||
sensitive?: boolean
|
||||
strict?: boolean
|
||||
end?: boolean
|
||||
}
|
||||
|
||||
export interface RouteConfig {
|
||||
path: string
|
||||
name?: string
|
||||
component?: Component
|
||||
components?: Dictionary<Component>
|
||||
redirect?: RedirectOption
|
||||
alias?: string | string[]
|
||||
children?: RouteConfig[]
|
||||
meta?: any
|
||||
beforeEnter?: NavigationGuard
|
||||
props?: boolean | Object | RoutePropsFunction
|
||||
caseSensitive?: boolean
|
||||
pathToRegexpOptions?: PathToRegexpOptions
|
||||
}
|
||||
|
||||
export interface RouteRecord {
|
||||
path: string
|
||||
regex: RegExp
|
||||
components: Dictionary<Component>
|
||||
instances: Dictionary<Vue>
|
||||
name?: string
|
||||
parent?: RouteRecord
|
||||
redirect?: RedirectOption
|
||||
matchAs?: string
|
||||
meta: any
|
||||
beforeEnter?: (
|
||||
route: Route,
|
||||
redirect: (location: RawLocation) => void,
|
||||
next: () => void
|
||||
) => any
|
||||
props:
|
||||
| boolean
|
||||
| Object
|
||||
| RoutePropsFunction
|
||||
| Dictionary<boolean | Object | RoutePropsFunction>
|
||||
}
|
||||
|
||||
export interface Location {
|
||||
name?: string
|
||||
path?: string
|
||||
hash?: string
|
||||
query?: Dictionary<string | (string | null)[] | null | undefined>
|
||||
params?: Dictionary<string>
|
||||
append?: boolean
|
||||
replace?: boolean
|
||||
}
|
||||
|
||||
export interface Route {
|
||||
path: string
|
||||
name?: string
|
||||
hash: string
|
||||
query: Dictionary<string | (string | null)[]>
|
||||
params: Dictionary<string>
|
||||
fullPath: string
|
||||
matched: RouteRecord[]
|
||||
redirectedFrom?: string
|
||||
meta?: any
|
||||
}
|
22
node_modules/vue-router/types/vue.d.ts
generated
vendored
Normal file
22
node_modules/vue-router/types/vue.d.ts
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Augment the typings of Vue.js
|
||||
*/
|
||||
|
||||
import Vue from 'vue'
|
||||
import VueRouter, { Route, RawLocation, NavigationGuard } from './index'
|
||||
|
||||
declare module 'vue/types/vue' {
|
||||
interface Vue {
|
||||
$router: VueRouter
|
||||
$route: Route
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'vue/types/options' {
|
||||
interface ComponentOptions<V extends Vue> {
|
||||
router?: VueRouter
|
||||
beforeRouteEnter?: NavigationGuard<V>
|
||||
beforeRouteLeave?: NavigationGuard<V>
|
||||
beforeRouteUpdate?: NavigationGuard<V>
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"axios": "^0.19.0"
|
||||
"axios": "^0.19.0",
|
||||
"vue-router": "^3.1.3"
|
||||
}
|
||||
}
|
||||
|
@ -33,3 +33,8 @@ ms@2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
|
||||
integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=
|
||||
|
||||
vue-router@^3.1.3:
|
||||
version "3.1.3"
|
||||
resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-3.1.3.tgz#e6b14fabc0c0ee9fda0e2cbbda74b350e28e412b"
|
||||
integrity sha512-8iSa4mGNXBjyuSZFCCO4fiKfvzqk+mhL0lnKuGcQtO1eoj8nq3CmbEG8FwK5QqoqwDgsjsf1GDuisDX4cdb/aQ==
|
||||
|
Loading…
x
Reference in New Issue
Block a user