You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// 添加全局属性,动态设置按钮标题app.mixin({mounted(){if(this.$el&&this.$el.classList?.contains('tiny-button')){constisChristmas=newDate().getMonth()===11&&newDate().getDate()===25;// 判断是否圣诞节isChristmas&&this.$el.setAttribute('title','Ho Ho Ho!')this.$el.classList.add('christmas');}},});
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
问题:如何在不修改 tiny-vue 源码的情况下实现组件的拓展功能
举个例子,又快到圣诞节和春节了,想给项目的按钮加点彩蛋,比如实现下面的效果:
目前的实现
实现的效果
问题
Beta Was this translation helpful? Give feedback.
All reactions