如果h忘记写再import里了,就显示不出来,说h没有被定义

news/2024/7/10 3:15:19 标签: vue
<template>
  <title>陈尼克</title>
  <div>
     {{ count }} {{ object.foo }}
  </div>
</template>

<script>
//import { defineProps, reactive } from 'vue'

//import { createApp, ref, reactive } from 'vue';
import { ref, reactive, h } from 'vue';
//const { createApp, ref, reactive } = Vue;
//const App = {
  export default {
  setup() {
    const count = ref(0)
    const object = reactive({foo: "bar",});

    return () => h("h1", [count.value, object.foo]);
  },
};
</script>
<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>

返回一个h函数
setup返回的setup函数返回的
大括号里都是参数




http://www.niftyadmin.cn/n/957715.html

相关文章

SPRINGBOOT返回数据NULL参数设为空字符串或空数组

SPRINGBOOT返回数据NULL参数设为空字符串或空数组 package com.ruoyi.framework.config.ResponseVoConfig.WebConfig;/*** Classname MyJsonMapper* Description TODO* Date 2022/1/20 0020 上午 10:39* Created by jcc*/ import com.fasterxml.jackson.core.JsonGenerator; im…

windows10+keras下的yolov3的快速使用及自己数据集的训练

引用&#xff1a; https://blog.csdn.net/u012746060/article/details/81183006#commentsedit 由于这篇大牛的文章有一点小问题&#xff0c;所以把其中的小问题修正之后&#xff0c;自己发布一篇&#xff0c;一下为正文&#xff1a; 一、环境要求 tensorflow-gpu keras pych…

MATLAB批量读取一个文件夹下的图片

转载自&#xff1a; https://blog.csdn.net/yaqin1112/article/details/80051772 file_path D:\mormal_dibright\;% 图像文件夹路径 img_path_list dir(strcat(file_path,*.bmp));%获取该文件夹中所有bmp格式的图像 img_num length(img_path_list);%获取图像总数量 …

sprinboot 日期格式化,时间格式化,日期时间格式化

DateTimeFormat(pattern "yyyy-MM-dd HH:mm") JsonFormat(pattern "yyyy-MM-dd HH:mm",timezone "GMT8") JSONField(format "yyyy-MM-dd HH:mm") private Date birthDay;

将Numpy数组保存为图像

转载自&#xff1a;https://blog.csdn.net/xijuezhu8128/article/details/79661016 有一个Numpy数组类型的矩阵&#xff0c;如何将它作为图像写入磁盘&#xff1f;任何格式的图像都行(PNG&#xff0c;JPEG&#xff0c;BMP ...)。 最佳解决办法 可以使用scipy.misc&#xff0c…

springboot集成swagger,出现 No mapping for GET /swagger-ui.html的错误

在尝试降低springboot版本和swagger版本都无法解决这个问题后 <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <version>2.9.2</version> …

python中shutil.copy()与shutil.copytree()的具体用法

shutil.copy() 模块具体用法 shutil.copy(source, destination)&#xff08;这种复制形式使用的前提是必须要有 os.chdir(你要处理的路径)&#xff09; source/destination 都是字符串形式的路劲&#xff0c;其中destination是&#xff1a; 1、可以是一…

SpringBoot整合Validation进行参数校验

目录 依赖 在controller中校验接收到的参数 Validation常用注解 异常处理 多级嵌套校验 分组校验 spring、lombok提供了一些参数校验的注解&#xff0c;比如Nullable、NonNull &#xff0c;但比较鸡肋&#xff0c;常用Validation的注解来校验controller接收到的参数。 以sprin…