Skip to content

三个点渲染代码块,为什么会报错标签没有闭合?代码块不是不进行js执行吗? #4983

@xiaotimo

Description

@xiaotimo
// Storage二次封装
import config from '../config'
export default {
    setItem(key, val) {
        let storage = this.getStroage();
        storage[key] = val;
        window.localStorage.setItem(config.namespace, JSON.stringify(storage));
    },
    getItem(key) {
        return this.getStroage()[key]
    },
    getStroage() {
        return JSON.parse(window.localStorage.getItem(config.namespace) || "{}");
    },
    clearItem(key) {
        let storage = this.getStroage()
        delete storage[key]
        window.localStorage.setItem(config.namespace, JSON.stringify(storage));
    },
    clearAll() {
        window.localStorage.clear()
    }
}

这段代码会报错[plugin:vite:vue] Element is missing end tag.
E:/dl/notbooks/docs/vue/vue3andkoa2/index.md:369:30
369| },
370| getStroage() {
371| return JSON.parse(window.localStorage.getItem(config.namespace) || "{}");
| ^
372| },
373| clearItem(key) {

Metadata

Metadata

Assignees

No one assigned

    Labels

    need more infoFurther information is requestedquestionThis is a question rather than an issue or pull request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions