mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-30 12:52:43 +08:00
fix: memory leak
This commit is contained in:
parent
c84b2f2e58
commit
da4394dee6
@ -30,7 +30,7 @@ import {
|
||||
warnOnce
|
||||
} from '../../_utils'
|
||||
import { backTopLight } from '../styles'
|
||||
import BackTopIcon from './BackTopIcon'
|
||||
import renderBackTopIcon from './BackTopIcon'
|
||||
import style from './styles/index.cssr'
|
||||
|
||||
export const backTopProps = {
|
||||
@ -301,7 +301,7 @@ export default defineComponent({
|
||||
}),
|
||||
resolveSlot(this.$slots.default, () => [
|
||||
<NBaseIcon clsPrefix={mergedClsPrefix}>
|
||||
{{ default: () => BackTopIcon }}
|
||||
{{ default: renderBackTopIcon }}
|
||||
</NBaseIcon>
|
||||
])
|
||||
)
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { h } from 'vue'
|
||||
|
||||
export default (
|
||||
export default () => (
|
||||
<svg
|
||||
viewBox="0 0 24 24"
|
||||
version="1.1"
|
||||
|
@ -2,29 +2,33 @@ import { defineComponent, h } from 'vue'
|
||||
import { useConfig } from '../../_mixins'
|
||||
import { useCarouselContext } from './CarouselContext'
|
||||
|
||||
const backwardIcon = (
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
|
||||
<g fill="none">
|
||||
<path
|
||||
d="M10.26 3.2a.75.75 0 0 1 .04 1.06L6.773 8l3.527 3.74a.75.75 0 1 1-1.1 1.02l-4-4.25a.75.75 0 0 1 0-1.02l4-4.25a.75.75 0 0 1 1.06-.04z"
|
||||
fill="currentColor"
|
||||
>
|
||||
</path>
|
||||
</g>
|
||||
</svg>
|
||||
)
|
||||
function renderBackwardIcon() {
|
||||
return (
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
|
||||
<g fill="none">
|
||||
<path
|
||||
d="M10.26 3.2a.75.75 0 0 1 .04 1.06L6.773 8l3.527 3.74a.75.75 0 1 1-1.1 1.02l-4-4.25a.75.75 0 0 1 0-1.02l4-4.25a.75.75 0 0 1 1.06-.04z"
|
||||
fill="currentColor"
|
||||
>
|
||||
</path>
|
||||
</g>
|
||||
</svg>
|
||||
)
|
||||
}
|
||||
|
||||
const forwardIcon = (
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
|
||||
<g fill="none">
|
||||
<path
|
||||
d="M5.74 3.2a.75.75 0 0 0-.04 1.06L9.227 8L5.7 11.74a.75.75 0 1 0 1.1 1.02l4-4.25a.75.75 0 0 0 0-1.02l-4-4.25a.75.75 0 0 0-1.06-.04z"
|
||||
fill="currentColor"
|
||||
>
|
||||
</path>
|
||||
</g>
|
||||
</svg>
|
||||
)
|
||||
function renderForwardIcon() {
|
||||
return (
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
|
||||
<g fill="none">
|
||||
<path
|
||||
d="M5.74 3.2a.75.75 0 0 0-.04 1.06L9.227 8L5.7 11.74a.75.75 0 1 0 1.1 1.02l4-4.25a.75.75 0 0 0 0-1.02l-4-4.25a.75.75 0 0 0-1.06-.04z"
|
||||
fill="currentColor"
|
||||
>
|
||||
</path>
|
||||
</g>
|
||||
</svg>
|
||||
)
|
||||
}
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CarouselArrow',
|
||||
@ -54,7 +58,7 @@ export default defineComponent({
|
||||
role="button"
|
||||
onClick={this.prev}
|
||||
>
|
||||
{backwardIcon}
|
||||
{renderBackwardIcon()}
|
||||
</div>
|
||||
<div
|
||||
class={[
|
||||
@ -65,7 +69,7 @@ export default defineComponent({
|
||||
role="button"
|
||||
onClick={this.next}
|
||||
>
|
||||
{forwardIcon}
|
||||
{renderForwardIcon()}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
@ -13,7 +13,6 @@ import {
|
||||
inject,
|
||||
type PropType,
|
||||
ref,
|
||||
toRef,
|
||||
Transition,
|
||||
withDirectives
|
||||
} from 'vue'
|
||||
@ -75,7 +74,7 @@ export default defineComponent({
|
||||
function handleResize(): void {
|
||||
syncCascaderMenuPosition()
|
||||
}
|
||||
useOnResize(selfElRef, handleResize, { show: toRef(props, 'show') })
|
||||
useOnResize(selfElRef, handleResize)
|
||||
function showErrorMessage(label: string): void {
|
||||
const {
|
||||
value: { loadingRequiredMessage }
|
||||
|
@ -246,8 +246,8 @@ export default defineComponent({
|
||||
colorTableHeader,
|
||||
colorTableHeaderModal,
|
||||
colorTableHeaderPopover,
|
||||
renderCheckMarkColor,
|
||||
renderCheckMarkColorDisabled,
|
||||
checkMarkColor,
|
||||
checkMarkColorDisabled,
|
||||
border,
|
||||
borderFocus,
|
||||
borderDisabled,
|
||||
@ -255,7 +255,7 @@ export default defineComponent({
|
||||
boxShadowFocus,
|
||||
textColor,
|
||||
textColorDisabled,
|
||||
renderCheckMarkColorDisabledChecked,
|
||||
checkMarkColorDisabledChecked,
|
||||
colorDisabledChecked,
|
||||
borderDisabledChecked,
|
||||
labelPadding,
|
||||
@ -286,10 +286,9 @@ export default defineComponent({
|
||||
'--n-color-disabled-checked': colorDisabledChecked,
|
||||
'--n-text-color': textColor,
|
||||
'--n-text-color-disabled': textColorDisabled,
|
||||
'--n-check-mark-color': renderCheckMarkColor,
|
||||
'--n-check-mark-color-disabled': renderCheckMarkColorDisabled,
|
||||
'--n-check-mark-color-disabled-checked':
|
||||
renderCheckMarkColorDisabledChecked,
|
||||
'--n-check-mark-color': checkMarkColor,
|
||||
'--n-check-mark-color-disabled': checkMarkColorDisabled,
|
||||
'--n-check-mark-color-disabled-checked': checkMarkColorDisabledChecked,
|
||||
'--n-font-size': fontSize,
|
||||
'--n-label-padding': labelPadding
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ import { useConfig, useLocale, useTheme, useThemeClass } from '../../_mixins'
|
||||
import { download } from '../../_utils'
|
||||
import { NTooltip } from '../../tooltip'
|
||||
import { imageLight } from '../styles'
|
||||
import { closeIcon, nextIcon, prevIcon } from './icons'
|
||||
import { renderCloseIcon, renderNextIcon, renderPrevIcon } from './icons'
|
||||
import {
|
||||
imageContextKey,
|
||||
imagePreviewSharedProps,
|
||||
@ -507,13 +507,13 @@ export default defineComponent({
|
||||
|
||||
const prevNode = withTooltip(
|
||||
<NBaseIcon clsPrefix={clsPrefix} onClick={this.handleSwitchPrev}>
|
||||
{{ default: () => prevIcon }}
|
||||
{{ default: renderPrevIcon }}
|
||||
</NBaseIcon>,
|
||||
'tipPrevious'
|
||||
)
|
||||
const nextNode = withTooltip(
|
||||
<NBaseIcon clsPrefix={clsPrefix} onClick={this.handleSwitchNext}>
|
||||
{{ default: () => nextIcon }}
|
||||
{{ default: renderNextIcon }}
|
||||
</NBaseIcon>,
|
||||
'tipNext'
|
||||
)
|
||||
@ -560,7 +560,7 @@ export default defineComponent({
|
||||
|
||||
const closeNode = withTooltip(
|
||||
<NBaseIcon clsPrefix={clsPrefix} onClick={this.toggleShow}>
|
||||
{{ default: () => closeIcon }}
|
||||
{{ default: renderCloseIcon }}
|
||||
</NBaseIcon>,
|
||||
'tipClose'
|
||||
)
|
||||
|
@ -1,28 +1,34 @@
|
||||
import { h } from 'vue'
|
||||
|
||||
export const prevIcon = (
|
||||
<svg viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M6 5C5.75454 5 5.55039 5.17688 5.50806 5.41012L5.5 5.5V14.5C5.5 14.7761 5.72386 15 6 15C6.24546 15 6.44961 14.8231 6.49194 14.5899L6.5 14.5V5.5C6.5 5.22386 6.27614 5 6 5ZM13.8536 5.14645C13.68 4.97288 13.4106 4.9536 13.2157 5.08859L13.1464 5.14645L8.64645 9.64645C8.47288 9.82001 8.4536 10.0894 8.58859 10.2843L8.64645 10.3536L13.1464 14.8536C13.3417 15.0488 13.6583 15.0488 13.8536 14.8536C14.0271 14.68 14.0464 14.4106 13.9114 14.2157L13.8536 14.1464L9.70711 10L13.8536 5.85355C14.0488 5.65829 14.0488 5.34171 13.8536 5.14645Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
</svg>
|
||||
)
|
||||
export function renderPrevIcon() {
|
||||
return (
|
||||
<svg viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M6 5C5.75454 5 5.55039 5.17688 5.50806 5.41012L5.5 5.5V14.5C5.5 14.7761 5.72386 15 6 15C6.24546 15 6.44961 14.8231 6.49194 14.5899L6.5 14.5V5.5C6.5 5.22386 6.27614 5 6 5ZM13.8536 5.14645C13.68 4.97288 13.4106 4.9536 13.2157 5.08859L13.1464 5.14645L8.64645 9.64645C8.47288 9.82001 8.4536 10.0894 8.58859 10.2843L8.64645 10.3536L13.1464 14.8536C13.3417 15.0488 13.6583 15.0488 13.8536 14.8536C14.0271 14.68 14.0464 14.4106 13.9114 14.2157L13.8536 14.1464L9.70711 10L13.8536 5.85355C14.0488 5.65829 14.0488 5.34171 13.8536 5.14645Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
</svg>
|
||||
)
|
||||
}
|
||||
|
||||
export const nextIcon = (
|
||||
<svg viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M13.5 5C13.7455 5 13.9496 5.17688 13.9919 5.41012L14 5.5V14.5C14 14.7761 13.7761 15 13.5 15C13.2545 15 13.0504 14.8231 13.0081 14.5899L13 14.5V5.5C13 5.22386 13.2239 5 13.5 5ZM5.64645 5.14645C5.82001 4.97288 6.08944 4.9536 6.28431 5.08859L6.35355 5.14645L10.8536 9.64645C11.0271 9.82001 11.0464 10.0894 10.9114 10.2843L10.8536 10.3536L6.35355 14.8536C6.15829 15.0488 5.84171 15.0488 5.64645 14.8536C5.47288 14.68 5.4536 14.4106 5.58859 14.2157L5.64645 14.1464L9.79289 10L5.64645 5.85355C5.45118 5.65829 5.45118 5.34171 5.64645 5.14645Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
</svg>
|
||||
)
|
||||
export function renderNextIcon() {
|
||||
return (
|
||||
<svg viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M13.5 5C13.7455 5 13.9496 5.17688 13.9919 5.41012L14 5.5V14.5C14 14.7761 13.7761 15 13.5 15C13.2545 15 13.0504 14.8231 13.0081 14.5899L13 14.5V5.5C13 5.22386 13.2239 5 13.5 5ZM5.64645 5.14645C5.82001 4.97288 6.08944 4.9536 6.28431 5.08859L6.35355 5.14645L10.8536 9.64645C11.0271 9.82001 11.0464 10.0894 10.9114 10.2843L10.8536 10.3536L6.35355 14.8536C6.15829 15.0488 5.84171 15.0488 5.64645 14.8536C5.47288 14.68 5.4536 14.4106 5.58859 14.2157L5.64645 14.1464L9.79289 10L5.64645 5.85355C5.45118 5.65829 5.45118 5.34171 5.64645 5.14645Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
</svg>
|
||||
)
|
||||
}
|
||||
|
||||
export const closeIcon = (
|
||||
<svg viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M4.089 4.216l.057-.07a.5.5 0 0 1 .638-.057l.07.057L10 9.293l5.146-5.147a.5.5 0 0 1 .638-.057l.07.057a.5.5 0 0 1 .057.638l-.057.07L10.707 10l5.147 5.146a.5.5 0 0 1 .057.638l-.057.07a.5.5 0 0 1-.638.057l-.07-.057L10 10.707l-5.146 5.147a.5.5 0 0 1-.638.057l-.07-.057a.5.5 0 0 1-.057-.638l.057-.07L9.293 10L4.146 4.854a.5.5 0 0 1-.057-.638l.057-.07l-.057.07z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
</svg>
|
||||
)
|
||||
export function renderCloseIcon() {
|
||||
return (
|
||||
<svg viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M4.089 4.216l.057-.07a.5.5 0 0 1 .638-.057l.07.057L10 9.293l5.146-5.147a.5.5 0 0 1 .638-.057l.07.057a.5.5 0 0 1 .057.638l-.057.07L10.707 10l5.147 5.146a.5.5 0 0 1 .057.638l-.057.07a.5.5 0 0 1-.638.057l-.07-.057L10 10.707l-5.146 5.147a.5.5 0 0 1-.638.057l-.07-.057a.5.5 0 0 1-.057-.638l.057-.07L9.293 10L4.146 4.854a.5.5 0 0 1-.057-.638l.057-.07l-.057.07z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
</svg>
|
||||
)
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ import { NBaseIcon } from '../../_internal'
|
||||
import { useConfig, useFormItem, useTheme, useThemeClass } from '../../_mixins'
|
||||
import { call, color2Class, createKey } from '../../_utils'
|
||||
import { rateLight } from '../styles'
|
||||
import StarIcon from './StarIcon'
|
||||
import renderStarIcon from './StarIcon'
|
||||
import style from './styles/index.cssr'
|
||||
|
||||
export const rateProps = {
|
||||
@ -204,7 +204,7 @@ export default defineComponent({
|
||||
defaultSlot({ index })
|
||||
) : (
|
||||
<NBaseIcon clsPrefix={mergedClsPrefix}>
|
||||
{{ default: () => StarIcon }}
|
||||
{{ default: renderStarIcon }}
|
||||
</NBaseIcon>
|
||||
)
|
||||
const entireStarActive
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { h } from 'vue'
|
||||
|
||||
export default (
|
||||
export default () => (
|
||||
<svg viewBox="0 0 512 512">
|
||||
<path d="M394 480a16 16 0 01-9.39-3L256 383.76 127.39 477a16 16 0 01-24.55-18.08L153 310.35 23 221.2a16 16 0 019-29.2h160.38l48.4-148.95a16 16 0 0130.44 0l48.4 149H480a16 16 0 019.05 29.2L359 310.35l50.13 148.53A16 16 0 01394 480z" />
|
||||
</svg>
|
||||
|
@ -1,14 +1,16 @@
|
||||
import { h } from 'vue'
|
||||
|
||||
export default (
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36">
|
||||
<path
|
||||
fill="#EF9645"
|
||||
d="M15.5 2.965c1.381 0 2.5 1.119 2.5 2.5v.005L20.5.465c1.381 0 2.5 1.119 2.5 2.5V4.25l2.5-1.535c1.381 0 2.5 1.119 2.5 2.5V8.75L29 18H15.458L15.5 2.965z"
|
||||
/>
|
||||
<path
|
||||
fill="#FFDC5D"
|
||||
d="M4.625 16.219c1.381-.611 3.354.208 4.75 2.188.917 1.3 1.187 3.151 2.391 3.344.46.073 1.234-.313 1.234-1.397V4.5s0-2 2-2 2 2 2 2v11.633c0-.029 1-.064 1-.082V2s0-2 2-2 2 2 2 2v14.053c0 .017 1 .041 1 .069V4.25s0-2 2-2 2 2 2 2v12.638c0 .118 1 .251 1 .398V8.75s0-2 2-2 2 2 2 2V24c0 6.627-5.373 12-12 12-4.775 0-8.06-2.598-9.896-5.292C8.547 28.423 8.096 26.051 8 25.334c0 0-.123-1.479-1.156-2.865-1.469-1.969-2.5-3.156-3.125-3.866-.317-.359-.625-1.707.906-2.384z"
|
||||
/>
|
||||
</svg>
|
||||
)
|
||||
export function render403() {
|
||||
return (
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36">
|
||||
<path
|
||||
fill="#EF9645"
|
||||
d="M15.5 2.965c1.381 0 2.5 1.119 2.5 2.5v.005L20.5.465c1.381 0 2.5 1.119 2.5 2.5V4.25l2.5-1.535c1.381 0 2.5 1.119 2.5 2.5V8.75L29 18H15.458L15.5 2.965z"
|
||||
/>
|
||||
<path
|
||||
fill="#FFDC5D"
|
||||
d="M4.625 16.219c1.381-.611 3.354.208 4.75 2.188.917 1.3 1.187 3.151 2.391 3.344.46.073 1.234-.313 1.234-1.397V4.5s0-2 2-2 2 2 2 2v11.633c0-.029 1-.064 1-.082V2s0-2 2-2 2 2 2 2v14.053c0 .017 1 .041 1 .069V4.25s0-2 2-2 2 2 2 2v12.638c0 .118 1 .251 1 .398V8.75s0-2 2-2 2 2 2 2V24c0 6.627-5.373 12-12 12-4.775 0-8.06-2.598-9.896-5.292C8.547 28.423 8.096 26.051 8 25.334c0 0-.123-1.479-1.156-2.865-1.469-1.969-2.5-3.156-3.125-3.866-.317-.359-.625-1.707.906-2.384z"
|
||||
/>
|
||||
</svg>
|
||||
)
|
||||
}
|
||||
|
@ -1,21 +1,23 @@
|
||||
import { h } from 'vue'
|
||||
|
||||
export default (
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36">
|
||||
<circle fill="#FFCB4C" cx="18" cy="17.018" r="17" />
|
||||
<path
|
||||
fill="#65471B"
|
||||
d="M14.524 21.036c-.145-.116-.258-.274-.312-.464-.134-.46.13-.918.59-1.021 4.528-1.021 7.577 1.363 7.706 1.465.384.306.459.845.173 1.205-.286.358-.828.401-1.211.097-.11-.084-2.523-1.923-6.182-1.098-.274.061-.554-.016-.764-.184z"
|
||||
/>
|
||||
<ellipse fill="#65471B" cx="13.119" cy="11.174" rx="2.125" ry="2.656" />
|
||||
<ellipse fill="#65471B" cx="24.375" cy="12.236" rx="2.125" ry="2.656" />
|
||||
<path
|
||||
fill="#F19020"
|
||||
d="M17.276 35.149s1.265-.411 1.429-1.352c.173-.972-.624-1.167-.624-1.167s1.041-.208 1.172-1.376c.123-1.101-.861-1.363-.861-1.363s.97-.4 1.016-1.539c.038-.959-.995-1.428-.995-1.428s5.038-1.221 5.556-1.341c.516-.12 1.32-.615 1.069-1.694-.249-1.08-1.204-1.118-1.697-1.003-.494.115-6.744 1.566-8.9 2.068l-1.439.334c-.54.127-.785-.11-.404-.512.508-.536.833-1.129.946-2.113.119-1.035-.232-2.313-.433-2.809-.374-.921-1.005-1.649-1.734-1.899-1.137-.39-1.945.321-1.542 1.561.604 1.854.208 3.375-.833 4.293-2.449 2.157-3.588 3.695-2.83 6.973.828 3.575 4.377 5.876 7.952 5.048l3.152-.681z"
|
||||
/>
|
||||
<path
|
||||
fill="#65471B"
|
||||
d="M9.296 6.351c-.164-.088-.303-.224-.391-.399-.216-.428-.04-.927.393-1.112 4.266-1.831 7.699-.043 7.843.034.433.231.608.747.391 1.154-.216.405-.74.546-1.173.318-.123-.063-2.832-1.432-6.278.047-.257.109-.547.085-.785-.042zm12.135 3.75c-.156-.098-.286-.243-.362-.424-.187-.442.023-.927.468-1.084 4.381-1.536 7.685.48 7.823.567.415.26.555.787.312 1.178-.242.39-.776.495-1.191.238-.12-.072-2.727-1.621-6.267-.379-.266.091-.553.046-.783-.096z"
|
||||
/>
|
||||
</svg>
|
||||
)
|
||||
export function render404() {
|
||||
return (
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36">
|
||||
<circle fill="#FFCB4C" cx="18" cy="17.018" r="17" />
|
||||
<path
|
||||
fill="#65471B"
|
||||
d="M14.524 21.036c-.145-.116-.258-.274-.312-.464-.134-.46.13-.918.59-1.021 4.528-1.021 7.577 1.363 7.706 1.465.384.306.459.845.173 1.205-.286.358-.828.401-1.211.097-.11-.084-2.523-1.923-6.182-1.098-.274.061-.554-.016-.764-.184z"
|
||||
/>
|
||||
<ellipse fill="#65471B" cx="13.119" cy="11.174" rx="2.125" ry="2.656" />
|
||||
<ellipse fill="#65471B" cx="24.375" cy="12.236" rx="2.125" ry="2.656" />
|
||||
<path
|
||||
fill="#F19020"
|
||||
d="M17.276 35.149s1.265-.411 1.429-1.352c.173-.972-.624-1.167-.624-1.167s1.041-.208 1.172-1.376c.123-1.101-.861-1.363-.861-1.363s.97-.4 1.016-1.539c.038-.959-.995-1.428-.995-1.428s5.038-1.221 5.556-1.341c.516-.12 1.32-.615 1.069-1.694-.249-1.08-1.204-1.118-1.697-1.003-.494.115-6.744 1.566-8.9 2.068l-1.439.334c-.54.127-.785-.11-.404-.512.508-.536.833-1.129.946-2.113.119-1.035-.232-2.313-.433-2.809-.374-.921-1.005-1.649-1.734-1.899-1.137-.39-1.945.321-1.542 1.561.604 1.854.208 3.375-.833 4.293-2.449 2.157-3.588 3.695-2.83 6.973.828 3.575 4.377 5.876 7.952 5.048l3.152-.681z"
|
||||
/>
|
||||
<path
|
||||
fill="#65471B"
|
||||
d="M9.296 6.351c-.164-.088-.303-.224-.391-.399-.216-.428-.04-.927.393-1.112 4.266-1.831 7.699-.043 7.843.034.433.231.608.747.391 1.154-.216.405-.74.546-1.173.318-.123-.063-2.832-1.432-6.278.047-.257.109-.547.085-.785-.042zm12.135 3.75c-.156-.098-.286-.243-.362-.424-.187-.442.023-.927.468-1.084 4.381-1.536 7.685.48 7.823.567.415.26.555.787.312 1.178-.242.39-.776.495-1.191.238-.12-.072-2.727-1.621-6.267-.379-.266.091-.553.046-.783-.096z"
|
||||
/>
|
||||
</svg>
|
||||
)
|
||||
}
|
||||
|
@ -1,18 +1,23 @@
|
||||
import { h } from 'vue'
|
||||
|
||||
export default (
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36">
|
||||
<ellipse fill="#292F33" cx="18" cy="26" rx="18" ry="10" />
|
||||
<ellipse fill="#66757F" cx="18" cy="24" rx="18" ry="10" />
|
||||
<path fill="#E1E8ED" d="M18 31C3.042 31 1 16 1 12h34c0 2-1.958 19-17 19z" />
|
||||
<path
|
||||
fill="#77B255"
|
||||
d="M35 12.056c0 5.216-7.611 9.444-17 9.444S1 17.271 1 12.056C1 6.84 8.611 3.611 18 3.611s17 3.229 17 8.445z"
|
||||
/>
|
||||
<ellipse fill="#A6D388" cx="18" cy="13" rx="15" ry="7" />
|
||||
<path
|
||||
d="M21 17c-.256 0-.512-.098-.707-.293-2.337-2.337-2.376-4.885-.125-8.262.739-1.109.9-2.246.478-3.377-.461-1.236-1.438-1.996-1.731-2.077-.553 0-.958-.443-.958-.996 0-.552.491-.995 1.043-.995.997 0 2.395 1.153 3.183 2.625 1.034 1.933.91 4.039-.351 5.929-1.961 2.942-1.531 4.332-.125 5.738.391.391.391 1.023 0 1.414-.195.196-.451.294-.707.294zm-6-2c-.256 0-.512-.098-.707-.293-2.337-2.337-2.376-4.885-.125-8.262.727-1.091.893-2.083.494-2.947-.444-.961-1.431-1.469-1.684-1.499-.552 0-.989-.447-.989-1 0-.552.458-1 1.011-1 .997 0 2.585.974 3.36 2.423.481.899 1.052 2.761-.528 5.131-1.961 2.942-1.531 4.332-.125 5.738.391.391.391 1.023 0 1.414-.195.197-.451.295-.707.295z"
|
||||
fill="#5C913B"
|
||||
/>
|
||||
</svg>
|
||||
)
|
||||
export function render418() {
|
||||
return (
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36">
|
||||
<ellipse fill="#292F33" cx="18" cy="26" rx="18" ry="10" />
|
||||
<ellipse fill="#66757F" cx="18" cy="24" rx="18" ry="10" />
|
||||
<path
|
||||
fill="#E1E8ED"
|
||||
d="M18 31C3.042 31 1 16 1 12h34c0 2-1.958 19-17 19z"
|
||||
/>
|
||||
<path
|
||||
fill="#77B255"
|
||||
d="M35 12.056c0 5.216-7.611 9.444-17 9.444S1 17.271 1 12.056C1 6.84 8.611 3.611 18 3.611s17 3.229 17 8.445z"
|
||||
/>
|
||||
<ellipse fill="#A6D388" cx="18" cy="13" rx="15" ry="7" />
|
||||
<path
|
||||
d="M21 17c-.256 0-.512-.098-.707-.293-2.337-2.337-2.376-4.885-.125-8.262.739-1.109.9-2.246.478-3.377-.461-1.236-1.438-1.996-1.731-2.077-.553 0-.958-.443-.958-.996 0-.552.491-.995 1.043-.995.997 0 2.395 1.153 3.183 2.625 1.034 1.933.91 4.039-.351 5.929-1.961 2.942-1.531 4.332-.125 5.738.391.391.391 1.023 0 1.414-.195.196-.451.294-.707.294zm-6-2c-.256 0-.512-.098-.707-.293-2.337-2.337-2.376-4.885-.125-8.262.727-1.091.893-2.083.494-2.947-.444-.961-1.431-1.469-1.684-1.499-.552 0-.989-.447-.989-1 0-.552.458-1 1.011-1 .997 0 2.585.974 3.36 2.423.481.899 1.052 2.761-.528 5.131-1.961 2.942-1.531 4.332-.125 5.738.391.391.391 1.023 0 1.414-.195.197-.451.295-.707.295z"
|
||||
fill="#5C913B"
|
||||
/>
|
||||
</svg>
|
||||
)
|
||||
}
|
||||
|
@ -1,15 +1,17 @@
|
||||
import { h } from 'vue'
|
||||
|
||||
export default (
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36">
|
||||
<path
|
||||
fill="#FFCC4D"
|
||||
d="M36 18c0 9.941-8.059 18-18 18-9.94 0-18-8.059-18-18C0 8.06 8.06 0 18 0c9.941 0 18 8.06 18 18"
|
||||
/>
|
||||
<ellipse fill="#664500" cx="18" cy="27" rx="5" ry="6" />
|
||||
<path
|
||||
fill="#664500"
|
||||
d="M5.999 11c-.208 0-.419-.065-.599-.2-.442-.331-.531-.958-.2-1.4C8.462 5.05 12.816 5 13 5c.552 0 1 .448 1 1 0 .551-.445.998-.996 1-.155.002-3.568.086-6.204 3.6-.196.262-.497.4-.801.4zm24.002 0c-.305 0-.604-.138-.801-.4-2.64-3.521-6.061-3.598-6.206-3.6-.55-.006-.994-.456-.991-1.005C22.006 5.444 22.45 5 23 5c.184 0 4.537.05 7.8 4.4.332.442.242 1.069-.2 1.4-.18.135-.39.2-.599.2zm-16.087 4.5l1.793-1.793c.391-.391.391-1.023 0-1.414s-1.023-.391-1.414 0L12.5 14.086l-1.793-1.793c-.391-.391-1.023-.391-1.414 0s-.391 1.023 0 1.414l1.793 1.793-1.793 1.793c-.391.391-.391 1.023 0 1.414.195.195.451.293.707.293s.512-.098.707-.293l1.793-1.793 1.793 1.793c.195.195.451.293.707.293s.512-.098.707-.293c.391-.391.391-1.023 0-1.414L13.914 15.5zm11 0l1.793-1.793c.391-.391.391-1.023 0-1.414s-1.023-.391-1.414 0L23.5 14.086l-1.793-1.793c-.391-.391-1.023-.391-1.414 0s-.391 1.023 0 1.414l1.793 1.793-1.793 1.793c-.391.391-.391 1.023 0 1.414.195.195.451.293.707.293s.512-.098.707-.293l1.793-1.793 1.793 1.793c.195.195.451.293.707.293s.512-.098.707-.293c.391-.391.391-1.023 0-1.414L24.914 15.5z"
|
||||
/>
|
||||
</svg>
|
||||
)
|
||||
export function render500() {
|
||||
return (
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36">
|
||||
<path
|
||||
fill="#FFCC4D"
|
||||
d="M36 18c0 9.941-8.059 18-18 18-9.94 0-18-8.059-18-18C0 8.06 8.06 0 18 0c9.941 0 18 8.06 18 18"
|
||||
/>
|
||||
<ellipse fill="#664500" cx="18" cy="27" rx="5" ry="6" />
|
||||
<path
|
||||
fill="#664500"
|
||||
d="M5.999 11c-.208 0-.419-.065-.599-.2-.442-.331-.531-.958-.2-1.4C8.462 5.05 12.816 5 13 5c.552 0 1 .448 1 1 0 .551-.445.998-.996 1-.155.002-3.568.086-6.204 3.6-.196.262-.497.4-.801.4zm24.002 0c-.305 0-.604-.138-.801-.4-2.64-3.521-6.061-3.598-6.206-3.6-.55-.006-.994-.456-.991-1.005C22.006 5.444 22.45 5 23 5c.184 0 4.537.05 7.8 4.4.332.442.242 1.069-.2 1.4-.18.135-.39.2-.599.2zm-16.087 4.5l1.793-1.793c.391-.391.391-1.023 0-1.414s-1.023-.391-1.414 0L12.5 14.086l-1.793-1.793c-.391-.391-1.023-.391-1.414 0s-.391 1.023 0 1.414l1.793 1.793-1.793 1.793c-.391.391-.391 1.023 0 1.414.195.195.451.293.707.293s.512-.098.707-.293l1.793-1.793 1.793 1.793c.195.195.451.293.707.293s.512-.098.707-.293c.391-.391.391-1.023 0-1.414L13.914 15.5zm11 0l1.793-1.793c.391-.391.391-1.023 0-1.414s-1.023-.391-1.414 0L23.5 14.086l-1.793-1.793c-.391-.391-1.023-.391-1.414 0s-.391 1.023 0 1.414l1.793 1.793-1.793 1.793c-.391.391-.391 1.023 0 1.414.195.195.451.293.707.293s.512-.098.707-.293l1.793-1.793 1.793 1.793c.195.195.451.293.707.293s.512-.098.707-.293c.391-.391.391-1.023 0-1.414L24.914 15.5z"
|
||||
/>
|
||||
</svg>
|
||||
)
|
||||
}
|
||||
|
@ -18,17 +18,17 @@ import {
|
||||
import { useConfig, useTheme, useThemeClass } from '../../_mixins'
|
||||
import { createKey } from '../../_utils'
|
||||
import { resultLight } from '../styles'
|
||||
import image403 from './403'
|
||||
import image404 from './404'
|
||||
import image418 from './418'
|
||||
import image500 from './500'
|
||||
import { render403 } from './403'
|
||||
import { render404 } from './404'
|
||||
import { render418 } from './418'
|
||||
import { render500 } from './500'
|
||||
import style from './styles/index.cssr'
|
||||
|
||||
const iconRenderMap = {
|
||||
403: () => image403,
|
||||
404: () => image404,
|
||||
418: () => image418,
|
||||
500: () => image500,
|
||||
403: render403,
|
||||
404: render404,
|
||||
418: render418,
|
||||
500: render500,
|
||||
info: () => <InfoIcon />,
|
||||
success: () => <SuccessIcon />,
|
||||
warning: () => <WarningIcon />,
|
||||
|
@ -32,35 +32,37 @@ import { lightTheme } from '../../themes/light'
|
||||
import { MaximizeIcon } from './MaximizeIcon'
|
||||
import { MinimizeIcon } from './MinimizeIcon'
|
||||
|
||||
const ColorWandIcon = (
|
||||
<svg
|
||||
viewBox="0 0 16 16"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
style={{ width: '1em', height: '1em', color: 'currentColor' }}
|
||||
>
|
||||
<path
|
||||
d="M13.5 1C13.7761 1 14 1.22386 14 1.5V2H14.5C14.7761 2 15 2.22386 15 2.5C15 2.77614 14.7761 3 14.5 3H14V3.5C14 3.77614 13.7761 4 13.5 4C13.2239 4 13 3.77614 13 3.5V3H12.5C12.2239 3 12 2.77614 12 2.5C12 2.22386 12.2239 2 12.5 2H13V1.5C13 1.22386 13.2239 1 13.5 1Z"
|
||||
fill="currentColor"
|
||||
function renderColorWandIcon() {
|
||||
return (
|
||||
<svg
|
||||
viewBox="0 0 16 16"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
style={{ width: '1em', height: '1em', color: 'currentColor' }}
|
||||
>
|
||||
</path>
|
||||
<path
|
||||
d="M3.5 3C3.77615 3 4 3.22386 4 3.5V4H4.5C4.77615 4 5 4.22386 5 4.5C5 4.77614 4.77615 5 4.5 5H4V5.5C4 5.77614 3.77615 6 3.5 6C3.22386 6 3 5.77614 3 5.5V5H2.5C2.22386 5 2 4.77614 2 4.5C2 4.22386 2.22386 4 2.5 4H3V3.5C3 3.22386 3.22386 3 3.5 3Z"
|
||||
fill="currentColor"
|
||||
>
|
||||
</path>
|
||||
<path
|
||||
d="M12.5 12C12.7761 12 13 11.7761 13 11.5C13 11.2239 12.7761 11 12.5 11H12V10.5C12 10.2239 11.7761 10 11.5 10C11.2239 10 11 10.2239 11 10.5V11H10.5C10.2239 11 10 11.2239 10 11.5C10 11.7761 10.2239 12 10.5 12H11V12.5C11 12.7761 11.2239 13 11.5 13C11.7761 13 12 12.7761 12 12.5V12H12.5Z"
|
||||
fill="currentColor"
|
||||
>
|
||||
</path>
|
||||
<path
|
||||
d="M8.72956 4.56346C9.4771 3.81592 10.6891 3.81592 11.4367 4.56347C12.1842 5.31102 12.1842 6.52303 11.4367 7.27058L4.26679 14.4404C3.51924 15.1879 2.30723 15.1879 1.55968 14.4404C0.812134 13.6928 0.812138 12.4808 1.55969 11.7333L8.72956 4.56346ZM8.25002 6.4572L2.26679 12.4404C1.90977 12.7974 1.90977 13.3763 2.26679 13.7333C2.62381 14.0903 3.20266 14.0903 3.55968 13.7333L9.54292 7.75009L8.25002 6.4572ZM10.25 7.04299L10.7295 6.56347C11.0866 6.20645 11.0866 5.6276 10.7296 5.27057C10.3725 4.91355 9.79368 4.91355 9.43666 5.27057L8.95713 5.7501L10.25 7.04299Z"
|
||||
fill="currentColor"
|
||||
>
|
||||
</path>
|
||||
</svg>
|
||||
)
|
||||
<path
|
||||
d="M13.5 1C13.7761 1 14 1.22386 14 1.5V2H14.5C14.7761 2 15 2.22386 15 2.5C15 2.77614 14.7761 3 14.5 3H14V3.5C14 3.77614 13.7761 4 13.5 4C13.2239 4 13 3.77614 13 3.5V3H12.5C12.2239 3 12 2.77614 12 2.5C12 2.22386 12.2239 2 12.5 2H13V1.5C13 1.22386 13.2239 1 13.5 1Z"
|
||||
fill="currentColor"
|
||||
>
|
||||
</path>
|
||||
<path
|
||||
d="M3.5 3C3.77615 3 4 3.22386 4 3.5V4H4.5C4.77615 4 5 4.22386 5 4.5C5 4.77614 4.77615 5 4.5 5H4V5.5C4 5.77614 3.77615 6 3.5 6C3.22386 6 3 5.77614 3 5.5V5H2.5C2.22386 5 2 4.77614 2 4.5C2 4.22386 2.22386 4 2.5 4H3V3.5C3 3.22386 3.22386 3 3.5 3Z"
|
||||
fill="currentColor"
|
||||
>
|
||||
</path>
|
||||
<path
|
||||
d="M12.5 12C12.7761 12 13 11.7761 13 11.5C13 11.2239 12.7761 11 12.5 11H12V10.5C12 10.2239 11.7761 10 11.5 10C11.2239 10 11 10.2239 11 10.5V11H10.5C10.2239 11 10 11.2239 10 11.5C10 11.7761 10.2239 12 10.5 12H11V12.5C11 12.7761 11.2239 13 11.5 13C11.7761 13 12 12.7761 12 12.5V12H12.5Z"
|
||||
fill="currentColor"
|
||||
>
|
||||
</path>
|
||||
<path
|
||||
d="M8.72956 4.56346C9.4771 3.81592 10.6891 3.81592 11.4367 4.56347C12.1842 5.31102 12.1842 6.52303 11.4367 7.27058L4.26679 14.4404C3.51924 15.1879 2.30723 15.1879 1.55968 14.4404C0.812134 13.6928 0.812138 12.4808 1.55969 11.7333L8.72956 4.56346ZM8.25002 6.4572L2.26679 12.4404C1.90977 12.7974 1.90977 13.3763 2.26679 13.7333C2.62381 14.0903 3.20266 14.0903 3.55968 13.7333L9.54292 7.75009L8.25002 6.4572ZM10.25 7.04299L10.7295 6.56347C11.0866 6.20645 11.0866 5.6276 10.7296 5.27057C10.3725 4.91355 9.79368 4.91355 9.43666 5.27057L8.95713 5.7501L10.25 7.04299Z"
|
||||
fill="currentColor"
|
||||
>
|
||||
</path>
|
||||
</svg>
|
||||
)
|
||||
}
|
||||
|
||||
// button colorOpacitySecondary var is not color
|
||||
function showColorPicker(key: string): boolean {
|
||||
@ -258,7 +260,7 @@ export default defineComponent({
|
||||
this.showPanel = !this.showPanel
|
||||
}}
|
||||
>
|
||||
{{ default: () => ColorWandIcon }}
|
||||
{{ default: renderColorWandIcon }}
|
||||
</NElement>
|
||||
),
|
||||
default: () => (
|
||||
|
@ -26,7 +26,7 @@ import {
|
||||
import { download, warn } from '../../_utils'
|
||||
import { NButton } from '../../button'
|
||||
import { NImage } from '../../image'
|
||||
import { documentIcon, imageIcon } from './icons'
|
||||
import { renderDocumentIcon, renderImageIcon } from './icons'
|
||||
import { uploadInjectionKey } from './interface'
|
||||
import NUploadProgress from './UploadProgress'
|
||||
import { isImageFile } from './utils'
|
||||
@ -265,11 +265,11 @@ export default defineComponent({
|
||||
renderIcon(file)
|
||||
) : isImageFile(file) ? (
|
||||
<NBaseIcon clsPrefix={clsPrefix}>
|
||||
{{ default: () => imageIcon }}
|
||||
{{ default: renderImageIcon }}
|
||||
</NBaseIcon>
|
||||
) : (
|
||||
<NBaseIcon clsPrefix={clsPrefix}>
|
||||
{{ default: () => documentIcon }}
|
||||
{{ default: renderDocumentIcon }}
|
||||
</NBaseIcon>
|
||||
)}
|
||||
</span>
|
||||
|
@ -5,7 +5,7 @@ import { h } from 'vue'
|
||||
* now.
|
||||
*/
|
||||
|
||||
export const imageIcon = (
|
||||
export const renderImageIcon = (
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28">
|
||||
<g fill="none">
|
||||
<path
|
||||
@ -17,7 +17,7 @@ export const imageIcon = (
|
||||
</svg>
|
||||
)
|
||||
|
||||
export const documentIcon = (
|
||||
export const renderDocumentIcon = (
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28">
|
||||
<g fill="none">
|
||||
<path
|
||||
|
Loading…
Reference in New Issue
Block a user