mirror of
				https://github.com/pure-admin/vue-pure-admin.git
				synced 2025-11-03 13:44:47 +08:00 
			
		
		
		
	perf: icon
This commit is contained in:
		
							parent
							
								
									378feceb5f
								
							
						
					
					
						commit
						8f5981a313
					
				@ -1,6 +1,6 @@
 | 
			
		||||
import { iconType } from "./types";
 | 
			
		||||
import { h, defineComponent, Component } from "vue";
 | 
			
		||||
import { IconifyIconOffline, FontIcon } from "../index";
 | 
			
		||||
import { IconifyIconOnline, IconifyIconOffline, FontIcon } from "../index";
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 支持fontawesome4、5+、iconfont、remixicon、element-plus的icons、自定义svg
 | 
			
		||||
@ -37,7 +37,9 @@ export function useRenderIcon(icon: string, attrs?: iconType): Component {
 | 
			
		||||
    return defineComponent({
 | 
			
		||||
      name: "Icon",
 | 
			
		||||
      render() {
 | 
			
		||||
        return h(IconifyIconOffline, {
 | 
			
		||||
        const IconifyIcon =
 | 
			
		||||
          attrs && attrs["online"] ? IconifyIconOnline : IconifyIconOffline;
 | 
			
		||||
        return h(IconifyIcon, {
 | 
			
		||||
          icon: icon,
 | 
			
		||||
          ...attrs
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
@ -11,7 +11,9 @@ export interface iconType {
 | 
			
		||||
  horizontalAlign?: boolean;
 | 
			
		||||
  verticalAlign?: boolean;
 | 
			
		||||
  align?: string;
 | 
			
		||||
  online?: boolean;
 | 
			
		||||
  onLoad?: Function;
 | 
			
		||||
  includes?: Function;
 | 
			
		||||
 | 
			
		||||
  //  all icon
 | 
			
		||||
  style?: object;
 | 
			
		||||
 | 
			
		||||
@ -59,6 +59,9 @@ function onBack() {
 | 
			
		||||
            clearable
 | 
			
		||||
            v-model="ruleForm.verifyCode"
 | 
			
		||||
            placeholder="短信验证码"
 | 
			
		||||
            :prefix-icon="
 | 
			
		||||
              useRenderIcon('ri:shield-keyhole-line', { online: true })
 | 
			
		||||
            "
 | 
			
		||||
          />
 | 
			
		||||
          <el-button
 | 
			
		||||
            :disabled="isDisabled"
 | 
			
		||||
 | 
			
		||||
@ -101,6 +101,9 @@ function onBack() {
 | 
			
		||||
            clearable
 | 
			
		||||
            v-model="ruleForm.verifyCode"
 | 
			
		||||
            placeholder="短信验证码"
 | 
			
		||||
            :prefix-icon="
 | 
			
		||||
              useRenderIcon('ri:shield-keyhole-line', { online: true })
 | 
			
		||||
            "
 | 
			
		||||
          />
 | 
			
		||||
          <el-button
 | 
			
		||||
            :disabled="isDisabled"
 | 
			
		||||
 | 
			
		||||
@ -80,6 +80,9 @@ function onBack() {
 | 
			
		||||
            clearable
 | 
			
		||||
            v-model="ruleForm.verifyCode"
 | 
			
		||||
            placeholder="短信验证码"
 | 
			
		||||
            :prefix-icon="
 | 
			
		||||
              useRenderIcon('ri:shield-keyhole-line', { online: true })
 | 
			
		||||
            "
 | 
			
		||||
          />
 | 
			
		||||
          <el-button
 | 
			
		||||
            :disabled="isDisabled"
 | 
			
		||||
 | 
			
		||||
@ -114,6 +114,9 @@ watch(imgCode, value => {
 | 
			
		||||
                clearable
 | 
			
		||||
                v-model="ruleForm.verifyCode"
 | 
			
		||||
                placeholder="验证码"
 | 
			
		||||
                :prefix-icon="
 | 
			
		||||
                  useRenderIcon('ri:shield-keyhole-line', { online: true })
 | 
			
		||||
                "
 | 
			
		||||
              >
 | 
			
		||||
                <template v-slot:append>
 | 
			
		||||
                  <ReImageVerify v-model:code="imgCode" />
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user