亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

javascript - Element-UI cannot customize the style
PHP中文網(wǎng)
PHP中文網(wǎng) 2017-05-24 11:37:16
0
5
1154
  • The key code in the vue file is almost as follows

<el-form-item>
   <el-input v-model="form.name" auto-complete="off" placeholder="手機號\郵箱\用戶名" class="login-form-input"></el-input>
</el-form-item>

<style>
    .login-form-input .el-input__inner {
        border: 0 none;
        border-bottom: 1px solid #ccc;
        border-radius: 0px;
    }
</style>
  • html rendered in the browser

  • But I don’t know why the compiled style selector was modified and an attribute selector was added.

I tried it. As long as the style is written in the vue file, an attribute selector will be added when compiled. How to do this? Does it mean that Element-UI can only roughly customize the theme, but cannot change too detailed things?


   ps:好吧,應該是我自己搭的框架有問題,我的鍋。因為我用 Element-UI 推薦的項目模板『element-starter』就沒問題。但還是想問下為什么會這樣
PHP中文網(wǎng)
PHP中文網(wǎng)

認證0級講師

reply all(5)
曾經(jīng)蠟筆沒有小新

<style scoped>

Peter_Zhu

One thing for sure is that it can be modified. You must be doing it wrong or the style priority is not as high as the element definition

PHPzhong

If the author wants to override the style of element, I have a few suggestions:

  • Override of common styles, such as base color or common style modification of element components, can be placed in a css file (or scss, etc.) in main.jsimport. element also provides a way to customize the theme

  • Non-universal styles, the style coverage of business components can be considered to be covered in the Vue single file component. At this time, it should be noted that it involves the issue of selector priority. Some styles need to use the global style of style (that is, not scoped) When using global styles, try to add the root component selector of the business component to avoid affecting the styles of element components in other components.

小葫蘆

Yes but the priority must be high

PHPzhong

Wrong,,,

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template