mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-27 05:00:48 +08:00
35 lines
559 B
Markdown
35 lines
559 B
Markdown
# 基础用法
|
|
Javascript、Python、Cpp 的例子。
|
|
```html
|
|
<div style="overflow: auto;">
|
|
<n-code :code="`
|
|
function sleep (ms = 1000) {
|
|
return new Promise(resolve => setTimeout(resolve, ms))
|
|
}
|
|
`" language="javascript" />
|
|
|
|
<n-code :code="`
|
|
def say_hello():
|
|
print('Hello Naive UI')
|
|
`" language="python" />
|
|
|
|
<n-code :code="cppCode" language="cpp" />
|
|
</div>
|
|
```
|
|
```js
|
|
export default {
|
|
data () {
|
|
return {
|
|
cppCode: `int main () {
|
|
std::cout << "Hello Naive UI";
|
|
return 0;
|
|
}`
|
|
}
|
|
}
|
|
}
|
|
```
|
|
```css
|
|
.n-code {
|
|
margin-bottom: 16px;
|
|
}
|
|
``` |