Last updated 6 years ago
Was this helpful?
如果你没有安装 Dahlia CLI,请看 。
使用 Dahlia CLI 初始化应用:
dh new friends
初始化成功后,启动本地开发服务器:
cd friends dh dev
启动成功后,在浏览器中你可以预览应用的运行效果,代码和运行效果如下:
import Dahlia from 'dahlia' import { routes } from './routes' Dahlia.bootstrap({ routes, selector: '#root', })
import { Routes } from 'dahlia' import { Home } from './pages/Home' export const routes: Routes = [ { path: '/', component: Home, }, ]
import React from 'react' export const Home = () => <div>Hi, Dahlia</div>
查看完整代码: