zzy-clock
Version:
277 lines (246 loc) • 8.91 kB
JavaScript
/******/ (function() { // webpackBootstrap
/******/ "use strict";
/******/ // The require scope
/******/ var __webpack_require__ = {};
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ !function() {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = function(exports, definition) {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ }();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ !function() {
/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
/******/ }();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ !function() {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ }();
/******/
/******/ /* webpack/runtime/publicPath */
/******/ !function() {
/******/ __webpack_require__.p = "";
/******/ }();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
"default": function() { return /* binding */ entry_lib; }
});
;// ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
/* eslint-disable no-var */
// This file is imported into lib/wc client bundles.
if (typeof window !== 'undefined') {
var currentScript = window.document.currentScript
if (false) { var getCurrentScript; }
var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/)
if (src) {
__webpack_require__.p = src[1] // eslint-disable-line
}
}
// Indicate to webpack that this file can be concatenated
/* harmony default export */ var setPublicPath = (null);
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/plugins/zzyClock/index.vue?vue&type=template&id=7f7c3a7e&scoped=true
var render = function render() {
var _vm = this,
_c = _vm._self._c;
return _c('div', {
attrs: {
"id": "clock"
}
}, [_c('div', {
staticClass: "box",
style: {
color: _vm.textColor
}
}, [_c('span', {
staticClass: "date"
}, [_vm._v(_vm._s(_vm.date))]), _c('span', {
staticClass: "time"
}, [_vm._v(_vm._s(_vm.time))])])]);
};
var staticRenderFns = [];
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/plugins/zzyClock/index.vue?vue&type=script&lang=js
/* harmony default export */ var zzyClockvue_type_script_lang_js = ({
name: "wqClock",
props: {
textColor: {
type: String,
default: "#2cf3fb"
}
},
data() {
return {
timer: null,
date: "",
time: ""
};
},
created() {
this.updateTime();
},
mounted() {
this.timer = setInterval(() => {
this.updateTime();
}, 1000);
},
methods: {
updateTime() {
let date = new Date();
let sDate = "-";
let sTime = ":";
let YYYY = formatHandle(date.getFullYear());
let MM = formatHandle(date.getMonth() + 1);
let DD = formatHandle(date.getDate());
let hh = formatHandle(date.getHours());
let mm = formatHandle(date.getMinutes());
let ss = formatHandle(date.getSeconds());
let w = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
let week = w[date.getDay()];
this.date = YYYY + sDate + MM + sDate + DD + ` ${week}`;
this.time = hh + sTime + mm + sTime + ss;
function formatHandle(value) {
if (value >= 0 && value < 10) return "0" + value;else return value;
}
}
},
beforeDestroy() {
clearInterval(this.timer);
}
});
;// ./src/plugins/zzyClock/index.vue?vue&type=script&lang=js
/* harmony default export */ var plugins_zzyClockvue_type_script_lang_js = (zzyClockvue_type_script_lang_js);
;// ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-32.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-32.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-32.use[2]!./node_modules/less-loader/dist/cjs.js??clonedRuleSet-32.use[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/plugins/zzyClock/index.vue?vue&type=style&index=0&id=7f7c3a7e&prod&lang=less&scoped=true
// extracted by mini-css-extract-plugin
;// ./src/plugins/zzyClock/index.vue?vue&type=style&index=0&id=7f7c3a7e&prod&lang=less&scoped=true
;// ./node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js
/* globals __VUE_SSR_CONTEXT__ */
// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
// This module is a runtime utility for cleaner component module output and will
// be included in the final webpack user bundle.
function normalizeComponent(
scriptExports,
render,
staticRenderFns,
functionalTemplate,
injectStyles,
scopeId,
moduleIdentifier /* server only */,
shadowMode /* vue-cli only */
) {
// Vue.extend constructor export interop
var options =
typeof scriptExports === 'function' ? scriptExports.options : scriptExports
// render functions
if (render) {
options.render = render
options.staticRenderFns = staticRenderFns
options._compiled = true
}
// functional template
if (functionalTemplate) {
options.functional = true
}
// scopedId
if (scopeId) {
options._scopeId = 'data-v-' + scopeId
}
var hook
if (moduleIdentifier) {
// server build
hook = function (context) {
// 2.3 injection
context =
context || // cached call
(this.$vnode && this.$vnode.ssrContext) || // stateful
(this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
// 2.2 with runInNewContext: true
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
context = __VUE_SSR_CONTEXT__
}
// inject component styles
if (injectStyles) {
injectStyles.call(this, context)
}
// register component module identifier for async chunk inferrence
if (context && context._registeredComponents) {
context._registeredComponents.add(moduleIdentifier)
}
}
// used by ssr in case component is cached and beforeCreate
// never gets called
options._ssrRegister = hook
} else if (injectStyles) {
hook = shadowMode
? function () {
injectStyles.call(
this,
(options.functional ? this.parent : this).$root.$options.shadowRoot
)
}
: injectStyles
}
if (hook) {
if (options.functional) {
// for template-only hot-reload because in that case the render fn doesn't
// go through the normalizer
options._injectStyles = hook
// register for functional component in vue file
var originalRender = options.render
options.render = function renderWithStyleInjection(h, context) {
hook.call(context)
return originalRender(h, context)
}
} else {
// inject component registration as beforeCreate hook
var existing = options.beforeCreate
options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
}
}
return {
exports: scriptExports,
options: options
}
}
;// ./src/plugins/zzyClock/index.vue
;
/* normalize component */
var component = normalizeComponent(
plugins_zzyClockvue_type_script_lang_js,
render,
staticRenderFns,
false,
null,
"7f7c3a7e",
null
)
/* harmony default export */ var zzyClock = (component.exports);
;// ./src/plugins/index.js
const install = Vue => {
Vue.component('ZzyClock', zzyClock);
};
/* harmony default export */ var plugins = (install);
;// ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
/* harmony default export */ var entry_lib = (plugins);
module.exports = __webpack_exports__;
/******/ })()
;
//# sourceMappingURL=zzy-clock.common.js.map