我将 Vue 的单文件组件规范 ( *.vue) 用于我的应用程序中的自定义组件。与rollup和一起rollup-plugin-vue,我观察到 DOM 中的输出,对于我编写的自定义组件,由等效的 html 元素组成。
例如:
component-a.vue
<template>
<span>Hello World</span>
</template>
<script>
export default { name: 'component-a' };
</script>
Run Code Online (Sandbox Code Playgroud)
component-b.vue
<template>
<component-a></component-a>
</template>
<script>
import ComponentA from './path/to/component-a.vue';
export default { name: 'component-b', components: { ComponentA } };
</script>
Run Code Online (Sandbox Code Playgroud)
上面的例子,如果component-a被添加到 Vue 挂载组件中,将会渲染到DOM 中两个组件的模板内容的总和,在这种情况下它只是一个span元素:
<span>Hello World<span>
Run Code Online (Sandbox Code Playgroud)
是否可以像下面的代码片段那样在 DOM 中实现渲染输出,这样自定义元素的模板在 DOM 中由保留其标签名称的标签表示?
<component-b>
<component-a>
<span>Hello World</span>
</component-a>
</component-b>
Run Code Online (Sandbox Code Playgroud) 我正在使用CLion 1.2为STM32目标构建嵌入式C项目.使用GNU ARM工具进行交叉编译很有效,但是,我想arm-none-eabi-size在构建可执行文件之后运行,并将该命令的输出打印到构建输出窗口.
我已经彻底查看了add_custom_command宏,但是,我不打算生成输出文件,这就是宏看起来要做的事情.
以下是CMakeLists.txt我在项目中使用的内容:
cmake_minimum_required(VERSION 3.3)
include(CMakeForceCompiler)
project(rtos_clion)
# -------------------------------------------------------------------
set(CMAKE_SYSTEM_PROCESSOR cortex-m0)
SET(CMAKE_SYSTEM_NAME Generic)
# Target Environment
SET(CMAKE_FIND_ROOT_PATH "C:/Program Files (x86)/GNU Tools ARM Embedded/4.9 2015q2")
# Cross compiler
CMAKE_FORCE_C_COMPILER(arm-none-eabi-gcc GNU)
CMAKE_FORCE_CXX_COMPILER(arm-none-eabi-g++ GNU)
# Executable type
set(CMAKE_EXECUTABLE_SUFFIX ".elf")
# Compiler flags
set(ARM_FLAGS "-mcpu=cortex-m0 -mthumb -Os")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARM_FLAGS} -std=gnu++11 -fabi-version=0 -fno-exceptions -fno-rtti -fno-use-cxa-atexit -fno-threadsafe-statics -ffunction-sections -g")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11 ${ARM_FLAGS} -ffunction-sections -fmessage-length=0 -fsigned-char -fdata-sections -ffreestanding -fno-move-loop-invariants -Wall -Wextra -g")
set(CMAKE_EXE_LINKER_FLAGS "${ARM_FLAGS} -g -Wl,--library-path=\"${PROJECT_SOURCE_DIR}\" -T …Run Code Online (Sandbox Code Playgroud)