在搜索了许多(很多!)快速游乐场问题甚至制作这些代码后,我仍然在苦苦挣扎.
我已经将一个文本文件放在Resources包内容的文件夹中,它在playground(/var/folders/ ...)生成的运行临时文件中显示为别名(链接).
import UIKit
let bundle = NSBundle.mainBundle()
let myFilePath = bundle.pathForResource("dict1", ofType: "txt")
println(myFilePath) // <-- this is correct, there is a shortcut to the Resource file at this location
var error:NSError?
var content = String(contentsOfFile:myFilePath!, encoding:NSUTF8StringEncoding, error: &error)
println(content!) // <-- this is *NOT* the file contents [EDIT: see later note]
// Demonstrate there's no error
if let theError = error {
print("\(theError.localizedDescription)")
} else {
print("No error")
}
Run Code Online (Sandbox Code Playgroud)
问题是,content …
我是 Vue 的新手。我想显示一些数据行,但我不想要数字 (ol) 或项目符号 (ul)。下面有替代我的方法吗?
<li v-for="product in contract.products">
<div class="p-1 row">
<div class="col-4">
<strong>{{ product.productName }}</strong>
</div>
<div class="col-4">
Allocation: {{ product.allocation }}
</div>
<div class="col-4">
Fulfilled: {{ product.allocationFulfilled }}
</div>
</div>
</li>
Run Code Online (Sandbox Code Playgroud)
非常感谢。