Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复iview-loader替换时的误伤 #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

EAGzzyCSL
Copy link

Circle在iview中指的是圆形进度条

iview-loader中会把Circle替换为i-circle以避免和web原生标签冲突

但匹配标签的正则只考虑了-分割的情况,会有误伤情况

比如下面代码中全局定义了一个CircleLoading组件

main.js

import Vue from 'vue'
import App from './App'
import iView from 'iview'

Vue.config.productionTip = false

Vue.use(iView)
import CircleLoading from './components/CircleLoading'

Vue.component('CircleLoading', CircleLoading)
new Vue({
  el: '#app',
  components: { App },
  template: '<App/>'
})

app.vue

<template>
  <div id="app">
    <CircleLoading/>
  </div>
</template>

<script>

export default {
  name: 'App',
}
</script>

<style>
</style>

CircleLoading会被替换为i-circleLoading而产生如下warning

[Vue warn]: Unknown custom element: <i-circleLoading> - did you register the component correctly

对应修改了一下正则的匹配规则,添加了ut。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant