摘要:
// 导入 bignumber.js 库 const { BigNumber } = require('bignumber.js'); // 封装加法函数 function add(a, b) { const result = new BigNumber(a).plus(b); return res 阅读全文
摘要:
import { Message } from 'element-ui' let lastMessageText = null let messageTimer = null export default function showMessage(options) { // 如果新的消息与上一条消息 阅读全文
摘要:
import Vue from 'vue' export function isOverflow(element) { if (element.scrollWidth > element.offsetWidth) { return element } return null } function g 阅读全文
摘要:
function isOverflow(element) { return element.scrollWidth > element.offsetWidth; } let element = document.querySelector('.ellipsis-span'); let resizeO 阅读全文
摘要:
增加key属性 阅读全文
摘要:
const fs = require('fs'); const path = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); class BuildTimePlugin { apply(compil 阅读全文
摘要:
在 Vue 中,你可以通过检查 Vue 实例的 $options.components 属性来判断一个组件是否已经被注册。这个属性包含了所有已经被注册的组件。 以下是一个示例: methods: { isComponentRegistered(componentName) { return this 阅读全文
摘要:
function broadcast(componentName, eventName, params) { this.$children.forEach((child) => { const name = child.$options.componentName; if (name compone 阅读全文
摘要:
import Vue from 'vue' const preventReClick = Vue.directive('preventReClick', { inserted: function(el, binding) { el.addEventListener('click', () => { 阅读全文
摘要:
function generateGradientColor(color1, color2, percentage) { // 将颜色转换为 RGB 格式 function hexToRgb(hex) { const bigint = parseInt(hex.replace('#', ''), 1 阅读全文